Package edu.american.student.redis.hadoop

Examples of edu.american.student.redis.hadoop.RedisBigTableKey


   * @throws RedisForemanException Writing to a table that does not exist
   */
  /*Test: RedisForemanTest.writeToTableTest*/
  public void write(byte[] table, byte[] row, byte[] cf, byte[] cq, byte[] value) throws RedisForemanException
  {
    write(table, new RedisBigTableKey(row, cf, cq), value);
  }
View Full Code Here


   * @throws RedisForemanException
   */
  /*Test: RedisForemanTest.writeToTableTest*/
  public void deleteRow(byte[] table, byte[] row, byte[] columnFamily, byte[] columnQualifier) throws RedisForemanException
  {
    deleteRow(table, new RedisBigTableKey(row, columnFamily, columnQualifier));
  }
View Full Code Here

    boolean hasWildCard = Utils.hasWildCard(cq);
    if (hasWildCard)
    {
      return getByFamily(table, row, cf);
    }
    Map<RedisBigTableKey, byte[]> entries = getByKey(table, new RedisBigTableKey(row, cf, cq));
    return entries;
  }
View Full Code Here

    {
      Map<RedisBigTableKey, byte[]> toReturn = new HashMap<RedisBigTableKey, byte[]>();
      Set<byte[]> redisKeys = instance.hkeys(table);
      for (byte[] value : redisKeys)
      {
        RedisBigTableKey inflated = RedisBigTableKey.inflate(value);
        if (inflated.matches(k))
        {
          byte[] val = instance.hget(table, inflated.toRedisField());
          if (val != null)
          {
            toReturn.put(inflated, val);
          }
        }
View Full Code Here

  public int getInstancesOfRow(byte[] row) throws RedisForemanException
  {
    byte[] r = ForemanConstants.RowIdentifierPart.ROW_LOG.getId();
    byte[] cf = row;
    byte[] cq = row;
    RedisBigTableKey rowKey = new RedisBigTableKey(r, cf, cq);
    Map<RedisBigTableKey, byte[]> returned = getByKey(ForemanConstants.TableIdentifier.ROW.getId(), rowKey);
    if (returned.isEmpty())
    {
      return 0;
    }
View Full Code Here

  private void incrementRow(byte[] row) throws RedisForemanException
  {
    byte[] r = ForemanConstants.RowIdentifierPart.ROW_LOG.getId();
    byte[] cf = row;
    byte[] cq = row;
    RedisBigTableKey rowKey = new RedisBigTableKey(r, cf, cq);
    Map<RedisBigTableKey, byte[]> returned = getByKey(ForemanConstants.TableIdentifier.ROW.getId(), rowKey);
    if (returned.isEmpty())
    {
      instance.hset(ForemanConstants.TableIdentifier.ROW.getId(), rowKey.toRedisField(), "1".getBytes());
    }
    else
    {
      int instanceOfRow = Integer.parseInt(new String(returned.entrySet().iterator().next().getValue()));
      instanceOfRow++;
      instance.hset(ForemanConstants.TableIdentifier.ROW.getId(), rowKey.toRedisField(), (instanceOfRow + "").getBytes());
    }
  }
View Full Code Here

  private void setRowInstanceCount(byte[] row, int instancesOfRow)
  {
    byte[] r = ForemanConstants.RowIdentifierPart.ROW_LOG.getId();
    byte[] cf = row;
    byte[] cq = row;
    RedisBigTableKey rowKey = new RedisBigTableKey(r, cf, cq);
    if (instancesOfRow > 0)
    {
      instance.hset(ForemanConstants.TableIdentifier.ROW.getId(), rowKey.toRedisField(), (instancesOfRow + "").getBytes());
    }
    else
    {
      instance.hdel(ForemanConstants.TableIdentifier.ROW.getId(), rowKey.toRedisField());
    }

  }
View Full Code Here

TOP

Related Classes of edu.american.student.redis.hadoop.RedisBigTableKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.