Java 类org.apache.hadoop.hbase.client.RowLock 实例源码

项目:LCIndex-HBase-0.94.16    文件:TestSerialization.java   
@Test public void testGet() throws Exception{
  byte[] row = "row".getBytes();
  byte[] fam = "fam".getBytes();
  byte[] qf1 = "qf1".getBytes();

  long ts = System.currentTimeMillis();
  int maxVersions = 2;
  long lockid = 5;
  RowLock rowLock = new RowLock(lockid);

  Get get = new Get(row, rowLock);
  get.addColumn(fam, qf1);
  get.setTimeRange(ts, ts+1);
  get.setMaxVersions(maxVersions);

  byte[] sb = Writables.getBytes(get);
  Get desGet = (Get)Writables.getWritable(sb, new Get());

  assertTrue(Bytes.equals(get.getRow(), desGet.getRow()));
  Set<byte[]> set = null;
  Set<byte[]> desSet = null;

  for(Map.Entry<byte[], NavigableSet<byte[]>> entry :
      get.getFamilyMap().entrySet()){
    assertTrue(desGet.getFamilyMap().containsKey(entry.getKey()));
    set = entry.getValue();
    desSet = desGet.getFamilyMap().get(entry.getKey());
    for(byte [] qualifier : set){
      assertTrue(desSet.contains(qualifier));
    }
  }

  assertEquals(get.getLockId(), desGet.getLockId());
  assertEquals(get.getMaxVersions(), desGet.getMaxVersions());
  TimeRange tr = get.getTimeRange();
  TimeRange desTr = desGet.getTimeRange();
  assertEquals(tr.getMax(), desTr.getMax());
  assertEquals(tr.getMin(), desTr.getMin());
}
项目:openyu-commons    文件:PoolableHConnection.java   
/**
 * @deprecated
 */
public RowLock lockRow(String tableName, byte[] paramArrayOfByte) throws IOException {
    checkOpen();
    try {
        HTableInterface table = getTable(tableName);
        return table.lockRow(paramArrayOfByte);
    } catch (IOException e) {
        handleException(e);
    }
    return null;
}
项目:openyu-commons    文件:PoolableHConnection.java   
/**
 * @deprecated
 */
public void unlockRow(String tableName, RowLock paramRowLock) throws IOException {
    checkOpen();
    try {
        HTableInterface table = getTable(tableName);
        table.unlockRow(paramRowLock);
    } catch (IOException e) {
        handleException(e);
    }
}
项目:IRIndex    文件:TestSerialization.java   
@Test public void testGet() throws Exception{
  byte[] row = "row".getBytes();
  byte[] fam = "fam".getBytes();
  byte[] qf1 = "qf1".getBytes();

  long ts = System.currentTimeMillis();
  int maxVersions = 2;
  long lockid = 5;
  RowLock rowLock = new RowLock(lockid);

  Get get = new Get(row, rowLock);
  get.addColumn(fam, qf1);
  get.setTimeRange(ts, ts+1);
  get.setMaxVersions(maxVersions);

  byte[] sb = Writables.getBytes(get);
  Get desGet = (Get)Writables.getWritable(sb, new Get());

  assertTrue(Bytes.equals(get.getRow(), desGet.getRow()));
  Set<byte[]> set = null;
  Set<byte[]> desSet = null;

  for(Map.Entry<byte[], NavigableSet<byte[]>> entry :
      get.getFamilyMap().entrySet()){
    assertTrue(desGet.getFamilyMap().containsKey(entry.getKey()));
    set = entry.getValue();
    desSet = desGet.getFamilyMap().get(entry.getKey());
    for(byte [] qualifier : set){
      assertTrue(desSet.contains(qualifier));
    }
  }

  assertEquals(get.getLockId(), desGet.getLockId());
  assertEquals(get.getMaxVersions(), desGet.getMaxVersions());
  TimeRange tr = get.getTimeRange();
  TimeRange desTr = desGet.getTimeRange();
  assertEquals(tr.getMax(), desTr.getMax());
  assertEquals(tr.getMin(), desTr.getMin());
}
项目:HBase-Research    文件:TestSerialization.java   
@Test public void testGet() throws Exception{
  byte[] row = "row".getBytes();
  byte[] fam = "fam".getBytes();
  byte[] qf1 = "qf1".getBytes();

  long ts = System.currentTimeMillis();
  int maxVersions = 2;
  long lockid = 5;
  RowLock rowLock = new RowLock(lockid);

  Get get = new Get(row, rowLock);
  get.addColumn(fam, qf1);
  get.setTimeRange(ts, ts+1);
  get.setMaxVersions(maxVersions);

  byte[] sb = Writables.getBytes(get);
  Get desGet = (Get)Writables.getWritable(sb, new Get());

  assertTrue(Bytes.equals(get.getRow(), desGet.getRow()));
  Set<byte[]> set = null;
  Set<byte[]> desSet = null;

  for(Map.Entry<byte[], NavigableSet<byte[]>> entry :
      get.getFamilyMap().entrySet()){
    assertTrue(desGet.getFamilyMap().containsKey(entry.getKey()));
    set = entry.getValue();
    desSet = desGet.getFamilyMap().get(entry.getKey());
    for(byte [] qualifier : set){
      assertTrue(desSet.contains(qualifier));
    }
  }

  assertEquals(get.getLockId(), desGet.getLockId());
  assertEquals(get.getMaxVersions(), desGet.getMaxVersions());
  TimeRange tr = get.getTimeRange();
  TimeRange desTr = desGet.getTimeRange();
  assertEquals(tr.getMax(), desTr.getMax());
  assertEquals(tr.getMin(), desTr.getMin());
}
项目:hbase-0.94.8-qod    文件:TestSerialization.java   
@Test public void testGet() throws Exception{
  byte[] row = "row".getBytes();
  byte[] fam = "fam".getBytes();
  byte[] qf1 = "qf1".getBytes();

  long ts = System.currentTimeMillis();
  int maxVersions = 2;
  long lockid = 5;
  RowLock rowLock = new RowLock(lockid);

  Get get = new Get(row, rowLock);
  get.addColumn(fam, qf1);
  get.setTimeRange(ts, ts+1);
  get.setMaxVersions(maxVersions);

  byte[] sb = Writables.getBytes(get);
  Get desGet = (Get)Writables.getWritable(sb, new Get());

  assertTrue(Bytes.equals(get.getRow(), desGet.getRow()));
  Set<byte[]> set = null;
  Set<byte[]> desSet = null;

  for(Map.Entry<byte[], NavigableSet<byte[]>> entry :
      get.getFamilyMap().entrySet()){
    assertTrue(desGet.getFamilyMap().containsKey(entry.getKey()));
    set = entry.getValue();
    desSet = desGet.getFamilyMap().get(entry.getKey());
    for(byte [] qualifier : set){
      assertTrue(desSet.contains(qualifier));
    }
  }

  assertEquals(get.getLockId(), desGet.getLockId());
  assertEquals(get.getMaxVersions(), desGet.getMaxVersions());
  TimeRange tr = get.getTimeRange();
  TimeRange desTr = desGet.getTimeRange();
  assertEquals(tr.getMax(), desTr.getMax());
  assertEquals(tr.getMin(), desTr.getMin());
}
项目:hbase-0.94.8-qod    文件:TestSerialization.java   
@Test public void testGet() throws Exception{
  byte[] row = "row".getBytes();
  byte[] fam = "fam".getBytes();
  byte[] qf1 = "qf1".getBytes();

  long ts = System.currentTimeMillis();
  int maxVersions = 2;
  long lockid = 5;
  RowLock rowLock = new RowLock(lockid);

  Get get = new Get(row, rowLock);
  get.addColumn(fam, qf1);
  get.setTimeRange(ts, ts+1);
  get.setMaxVersions(maxVersions);

  byte[] sb = Writables.getBytes(get);
  Get desGet = (Get)Writables.getWritable(sb, new Get());

  assertTrue(Bytes.equals(get.getRow(), desGet.getRow()));
  Set<byte[]> set = null;
  Set<byte[]> desSet = null;

  for(Map.Entry<byte[], NavigableSet<byte[]>> entry :
      get.getFamilyMap().entrySet()){
    assertTrue(desGet.getFamilyMap().containsKey(entry.getKey()));
    set = entry.getValue();
    desSet = desGet.getFamilyMap().get(entry.getKey());
    for(byte [] qualifier : set){
      assertTrue(desSet.contains(qualifier));
    }
  }

  assertEquals(get.getLockId(), desGet.getLockId());
  assertEquals(get.getMaxVersions(), desGet.getMaxVersions());
  TimeRange tr = get.getTimeRange();
  TimeRange desTr = desGet.getTimeRange();
  assertEquals(tr.getMax(), desTr.getMax());
  assertEquals(tr.getMin(), desTr.getMin());
}
项目:DominoHBase    文件:TestSerialization.java   
@Test public void testGet() throws Exception{
  byte[] row = "row".getBytes();
  byte[] fam = "fam".getBytes();
  byte[] qf1 = "qf1".getBytes();

  long ts = System.currentTimeMillis();
  int maxVersions = 2;
  long lockid = 5;
  RowLock rowLock = new RowLock(lockid);

  Get get = new Get(row, rowLock);
  get.addColumn(fam, qf1);
  get.setTimeRange(ts, ts+1);
  get.setMaxVersions(maxVersions);

  ClientProtos.Get getProto = ProtobufUtil.toGet(get);
  Get desGet = ProtobufUtil.toGet(getProto);

  assertTrue(Bytes.equals(get.getRow(), desGet.getRow()));
  Set<byte[]> set = null;
  Set<byte[]> desSet = null;

  for(Map.Entry<byte[], NavigableSet<byte[]>> entry :
      get.getFamilyMap().entrySet()){
    assertTrue(desGet.getFamilyMap().containsKey(entry.getKey()));
    set = entry.getValue();
    desSet = desGet.getFamilyMap().get(entry.getKey());
    for(byte [] qualifier : set){
      assertTrue(desSet.contains(qualifier));
    }
  }

  assertEquals(get.getLockId(), desGet.getLockId());
  assertEquals(get.getMaxVersions(), desGet.getMaxVersions());
  TimeRange tr = get.getTimeRange();
  TimeRange desTr = desGet.getTimeRange();
  assertEquals(tr.getMax(), desTr.getMax());
  assertEquals(tr.getMin(), desTr.getMin());
}
项目:hindex    文件:TestSerialization.java   
@Test public void testGet() throws Exception{
  byte[] row = "row".getBytes();
  byte[] fam = "fam".getBytes();
  byte[] qf1 = "qf1".getBytes();

  long ts = System.currentTimeMillis();
  int maxVersions = 2;
  long lockid = 5;
  RowLock rowLock = new RowLock(lockid);

  Get get = new Get(row, rowLock);
  get.addColumn(fam, qf1);
  get.setTimeRange(ts, ts+1);
  get.setMaxVersions(maxVersions);

  byte[] sb = Writables.getBytes(get);
  Get desGet = (Get)Writables.getWritable(sb, new Get());

  assertTrue(Bytes.equals(get.getRow(), desGet.getRow()));
  Set<byte[]> set = null;
  Set<byte[]> desSet = null;

  for(Map.Entry<byte[], NavigableSet<byte[]>> entry :
      get.getFamilyMap().entrySet()){
    assertTrue(desGet.getFamilyMap().containsKey(entry.getKey()));
    set = entry.getValue();
    desSet = desGet.getFamilyMap().get(entry.getKey());
    for(byte [] qualifier : set){
      assertTrue(desSet.contains(qualifier));
    }
  }

  assertEquals(get.getLockId(), desGet.getLockId());
  assertEquals(get.getMaxVersions(), desGet.getMaxVersions());
  TimeRange tr = get.getTimeRange();
  TimeRange desTr = desGet.getTimeRange();
  assertEquals(tr.getMax(), desTr.getMax());
  assertEquals(tr.getMin(), desTr.getMin());
}
项目:LCIndex-HBase-0.94.16    文件:RemoteHTable.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated
 */
public RowLock lockRow(byte[] row) throws IOException {
  throw new IOException("lockRow not implemented");
}
项目:LCIndex-HBase-0.94.16    文件:RemoteHTable.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated
 */
public void unlockRow(RowLock rl) throws IOException {
  throw new IOException("unlockRow not implemented");
}
项目:LCIndex-HBase-0.94.16    文件:CoprocessorHost.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated.
 */
public RowLock lockRow(byte[] row) throws IOException {
  throw new RuntimeException(
    "row locking is not allowed within the coprocessor environment");
}
项目:LCIndex-HBase-0.94.16    文件:CoprocessorHost.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated.
 */
public void unlockRow(RowLock rl) throws IOException {
  throw new RuntimeException(
    "row locking is not allowed within the coprocessor environment");
}
项目:uzaygezen    文件:MockHTable.java   
@Override
public RowLock lockRow(byte[] row) throws IOException {
  return null;
}
项目:uzaygezen    文件:MockHTable.java   
@Override
public void unlockRow(RowLock rl) throws IOException {
}
项目:openyu-commons    文件:HzSessionImpl.java   
/** @deprecated */
public RowLock lockRow(String tableName, byte[] paramArrayOfByte)
        throws IOException {
    return poolableHConnection.lockRow(tableName, paramArrayOfByte);
}
项目:openyu-commons    文件:HzSessionImpl.java   
/** @deprecated */
public void unlockRow(String tableName, RowLock paramRowLock)
        throws IOException {
    poolableHConnection.unlockRow(tableName, paramRowLock);
}
项目:openyu-commons    文件:PoolableHTable.java   
/** @deprecated */
public RowLock lockRow(byte[] row) throws IOException {
    return this.delegate.lockRow(row);
}
项目:openyu-commons    文件:PoolableHTable.java   
/** @deprecated */
public void unlockRow(RowLock rl) throws IOException {
    this.delegate.unlockRow(rl);
}
项目:openyu-commons    文件:HzSession.java   
/** @deprecated */
RowLock lockRow(String tableName, byte[] paramArrayOfByte) throws IOException;
项目:openyu-commons    文件:HzSession.java   
/** @deprecated */
void unlockRow(String tableName, RowLock paramRowLock) throws IOException;
项目:IRIndex    文件:RemoteHTable.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated
 */
public RowLock lockRow(byte[] row) throws IOException {
  throw new IOException("lockRow not implemented");
}
项目:IRIndex    文件:RemoteHTable.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated
 */
public void unlockRow(RowLock rl) throws IOException {
  throw new IOException("unlockRow not implemented");
}
项目:IRIndex    文件:CoprocessorHost.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated.
 */
public RowLock lockRow(byte[] row) throws IOException {
  throw new RuntimeException(
    "row locking is not allowed within the coprocessor environment");
}
项目:IRIndex    文件:CoprocessorHost.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated.
 */
public void unlockRow(RowLock rl) throws IOException {
  throw new RuntimeException(
    "row locking is not allowed within the coprocessor environment");
}
项目:RStore    文件:RemoteHTable.java   
public RowLock lockRow(byte[] row) throws IOException {
  throw new IOException("lockRow not implemented");
}
项目:RStore    文件:RemoteHTable.java   
public void unlockRow(RowLock rl) throws IOException {
  throw new IOException("unlockRow not implemented");
}
项目:gora-0.3-simplified    文件:HBaseTableConnection.java   
@Override
public RowLock lockRow(byte[] row) throws IOException {
  return getTable().lockRow(row);
}
项目:gora-0.3-simplified    文件:HBaseTableConnection.java   
@Override
public void unlockRow(RowLock rl) throws IOException {
  getTable().unlockRow(rl);
}
项目:HBase-Research    文件:RemoteHTable.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated
 */
public RowLock lockRow(byte[] row) throws IOException {
  throw new IOException("lockRow not implemented");
}
项目:HBase-Research    文件:RemoteHTable.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated
 */
public void unlockRow(RowLock rl) throws IOException {
  throw new IOException("unlockRow not implemented");
}
项目:HBase-Research    文件:CoprocessorHost.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated.
 */
public RowLock lockRow(byte[] row) throws IOException {
  throw new RuntimeException(
    "row locking is not allowed within the coprocessor environment");
}
项目:HBase-Research    文件:CoprocessorHost.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated.
 */
public void unlockRow(RowLock rl) throws IOException {
  throw new RuntimeException(
    "row locking is not allowed within the coprocessor environment");
}
项目:hbase-0.94.8-qod    文件:RemoteHTable.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated
 */
public RowLock lockRow(byte[] row) throws IOException {
  throw new IOException("lockRow not implemented");
}
项目:hbase-0.94.8-qod    文件:RemoteHTable.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated
 */
public void unlockRow(RowLock rl) throws IOException {
  throw new IOException("unlockRow not implemented");
}
项目:hbase-0.94.8-qod    文件:CoprocessorHost.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated.
 */
public RowLock lockRow(byte[] row) throws IOException {
  throw new RuntimeException(
    "row locking is not allowed within the coprocessor environment");
}
项目:hbase-0.94.8-qod    文件:CoprocessorHost.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated.
 */
public void unlockRow(RowLock rl) throws IOException {
  throw new RuntimeException(
    "row locking is not allowed within the coprocessor environment");
}
项目:hbase-0.94.8-qod    文件:RemoteHTable.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated
 */
public RowLock lockRow(byte[] row) throws IOException {
  throw new IOException("lockRow not implemented");
}
项目:hbase-0.94.8-qod    文件:RemoteHTable.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated
 */
public void unlockRow(RowLock rl) throws IOException {
  throw new IOException("unlockRow not implemented");
}
项目:hbase-0.94.8-qod    文件:CoprocessorHost.java   
/**
 * @deprecated {@link RowLock} and associated operations are deprecated.
 */
public RowLock lockRow(byte[] row) throws IOException {
  throw new RuntimeException(
    "row locking is not allowed within the coprocessor environment");
}