Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.RowLock


    startRegionOperation();
    this.writeRequestsCount.increment();
    this.opMetrics.setWriteRequestCountMetrics(this.writeRequestsCount.get());
    try {
      RowLock lock = isPut ? ((Put)w).getRowLock() : ((Delete)w).getRowLock();
      Get get = new Get(row, lock);
      checkFamily(family);
      get.addColumn(family, qualifier);

      // Lock row
View Full Code Here


       byte[] row = randomRowKey();
       Put put = new Put(row);
       put.add(cf, row, row);
       hTable.put(put);

       RowLock lock = hTable.lockRow(row);
       lock.getLockId();
       hTable.unlockRow(lock);

       assertMetricsUpdated(OpType.PUT, OpType.LOCKROW, OpType.UNLOCKROW);
   }
View Full Code Here

    // We can't simply use incrementColumnValue here because the timestamp of
    // the keyvalue will not be changed as long as it remains in memstore, so
    // there will be some unavoidable contention on the row if multiple
    // Stargate instances are concurrently serving the same user, and three
    // more round trips than otherwise.
    RowLock rl = table.lockRow(row);
    try {
      Get get = new Get(row, rl);
      get.addColumn(USER, TOKENS);
      List<KeyValue> kvs = table.get(get).list();
      if (kvs != null && !kvs.isEmpty()) {
View Full Code Here

    }

    startRegionOperation();
    this.writeRequestsCount.increment();
    try {
      RowLock lock = isPut ? ((Put)w).getRowLock() : ((Delete)w).getRowLock();
      Get get = new Get(row, lock);
      checkFamily(family);
      get.addColumn(family, qualifier);

      // Lock row
View Full Code Here

    startRegionOperation();
    this.writeRequestsCount.increment();
    this.opMetrics.setWriteRequestCountMetrics(this.writeRequestsCount.get());
    try {
      RowLock lock = isPut ? ((Put)w).getRowLock() : ((Delete)w).getRowLock();
      Get get = new Get(row, lock);
      checkFamily(family);
      get.addColumn(family, qualifier);

      // Lock row
View Full Code Here

    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);
View Full Code Here

    startRegionOperation();
    this.writeRequestsCount.increment();
    this.opMetrics.setWriteRequestCountMetrics(this.writeRequestsCount.get());
    try {
      RowLock lock = isPut ? ((Put)w).getRowLock() : ((Delete)w).getRowLock();
      Get get = new Get(row, lock);
      checkFamily(family);
      get.addColumn(family, qualifier);

      // Lock row
View Full Code Here

      timestamp = proto.getTimestamp();
    }
    if (timestampTransaction != null) {
      timestamp = timestampTransaction;
    }
    RowLock lock = null;
    if (proto.hasLockId()) {
      lock = new RowLock(proto.getLockId());
    }
    Put put = new Put(row, timestamp, lock);
    put.setWriteToWAL(proto.getWriteToWAL());
    for (WaspProtos.StringBytesPair attribute : proto.getAttributeList()) {
      put.setAttribute(attribute.getName(), attribute.getValue().toByteArray());
View Full Code Here

      timestamp = proto.getTimestamp();
    }
    if (timestampTransaction != null) {
      timestamp = timestampTransaction;
    }
    RowLock lock = null;
    if (proto.hasLockId()) {
      lock = new RowLock(proto.getLockId());
    }
    Delete delete = new Delete(row, timestamp, lock);
    delete.setWriteToWAL(proto.getWriteToWAL());
    for (WaspProtos.StringBytesPair attribute : proto.getAttributeList()) {
      delete.setAttribute(attribute.getName(), attribute.getValue()
View Full Code Here

    startRegionOperation();
    this.writeRequestsCount.increment();
    this.opMetrics.setWriteRequestCountMetrics(this.writeRequestsCount.get());
    try {
      RowLock lock = isPut ? ((Put)w).getRowLock() : ((Delete)w).getRowLock();
      Get get = new Get(row, lock);
      checkFamily(family);
      get.addColumn(family, qualifier);

      // Lock row
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.client.RowLock

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.