Examples of RowLock


Examples of org.apache.hadoop.hbase.regionserver.HRegion.RowLock

      }

      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 2, source);

      LOG.info("Next a batch put that has to break into two batches to avoid a lock");
      RowLock rowLock = region.getRowLock(Bytes.toBytes("row_2"));

      MultithreadedTestUtil.TestContext ctx = new MultithreadedTestUtil.TestContext(conf);
      final AtomicReference<OperationStatus[]> retFromThread = new AtomicReference<OperationStatus[]>();
      TestThread putter = new TestThread(ctx) {
        @Override
        public void doWork() throws IOException {
          retFromThread.set(region.batchMutate(puts));
        }
      };
      LOG.info("...starting put thread while holding lock");
      ctx.addThread(putter);
      ctx.startThreads();

      LOG.info("...waiting for put thread to sync first time");
      long startWait = System.currentTimeMillis();
      while (metricsAssertHelper.getCounter("syncTimeNumOps", source) == syncs + 2) {
        Thread.sleep(100);
        if (System.currentTimeMillis() - startWait > 10000) {
          fail("Timed out waiting for thread to sync first minibatch");
        }
      }
      LOG.info("...releasing row lock, which should let put thread continue");
      rowLock.release();
      LOG.info("...joining on thread");
      ctx.stop();
      LOG.info("...checking that next batch was synced");
      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 4, source);
      codes = retFromThread.get();
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.HRegion.RowLock

      }

      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 2, source);

      LOG.info("Next a batch put that has to break into two batches to avoid a lock");
      RowLock rowLock = region.getRowLock(Bytes.toBytes("row_2"));

      MultithreadedTestUtil.TestContext ctx = new MultithreadedTestUtil.TestContext(CONF);
      final AtomicReference<OperationStatus[]> retFromThread = new AtomicReference<OperationStatus[]>();
      TestThread putter = new TestThread(ctx) {
        @Override
        public void doWork() throws IOException {
          retFromThread.set(region.batchMutate(puts));
        }
      };
      LOG.info("...starting put thread while holding lock");
      ctx.addThread(putter);
      ctx.startThreads();

      LOG.info("...waiting for put thread to sync first time");
      long startWait = System.currentTimeMillis();
      while (metricsAssertHelper.getCounter("syncTimeNumOps", source) == syncs + 2) {
        Thread.sleep(100);
        if (System.currentTimeMillis() - startWait > 10000) {
          fail("Timed out waiting for thread to sync first minibatch");
        }
      }
      LOG.info("...releasing row lock, which should let put thread continue");
      rowLock.release();
      LOG.info("...joining on thread");
      ctx.stop();
      LOG.info("...checking that next batch was synced");
      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 4, source);
      codes = retFromThread.get();
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.HRegion.RowLock

      }

      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 2, source);

      LOG.info("Next a batch put that has to break into two batches to avoid a lock");
      RowLock rowLock = region.getRowLock(Bytes.toBytes("row_2"));

      MultithreadedTestUtil.TestContext ctx =
        new MultithreadedTestUtil.TestContext(conf);
      final AtomicReference<OperationStatus[]> retFromThread =
        new AtomicReference<OperationStatus[]>();
      TestThread putter = new TestThread(ctx) {
        @Override
        public void doWork() throws IOException {
          retFromThread.set(region.batchMutate(puts));
        }
      };
      LOG.info("...starting put thread while holding lock");
      ctx.addThread(putter);
      ctx.startThreads();

      LOG.info("...waiting for put thread to sync first time");
      long startWait = System.currentTimeMillis();
      while (metricsAssertHelper.getCounter("syncTimeNumOps", source) == syncs +2 ) {
        Thread.sleep(100);
        if (System.currentTimeMillis() - startWait > 10000) {
          fail("Timed out waiting for thread to sync first minibatch");
        }
      }
      LOG.info("...releasing row lock, which should let put thread continue");
      rowLock.release();
      LOG.info("...joining on thread");
      ctx.stop();
      LOG.info("...checking that next batch was synced");
      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 4, source);
      codes = retFromThread.get();
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.HRegion.RowLock

      }

      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 2, source);

      LOG.info("Next a batch put that has to break into two batches to avoid a lock");
      RowLock rowLock = region.getRowLock(Bytes.toBytes("row_2"));

      MultithreadedTestUtil.TestContext ctx = new MultithreadedTestUtil.TestContext(CONF);
      final AtomicReference<OperationStatus[]> retFromThread = new AtomicReference<OperationStatus[]>();
      TestThread putter = new TestThread(ctx) {
        @Override
        public void doWork() throws IOException {
          retFromThread.set(region.batchMutate(puts));
        }
      };
      LOG.info("...starting put thread while holding lock");
      ctx.addThread(putter);
      ctx.startThreads();

      LOG.info("...waiting for put thread to sync first time");
      long startWait = System.currentTimeMillis();
      while (metricsAssertHelper.getCounter("syncTimeNumOps", source) == syncs + 2) {
        Thread.sleep(100);
        if (System.currentTimeMillis() - startWait > 10000) {
          fail("Timed out waiting for thread to sync first minibatch");
        }
      }
      LOG.info("...releasing row lock, which should let put thread continue");
      rowLock.release();
      LOG.info("...joining on thread");
      ctx.stop();
      LOG.info("...checking that next batch was synced");
      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 4, source);
      codes = retFromThread.get();
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.HRegion.RowLock

      }

      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 2, source);

      LOG.info("Next a batch put that has to break into two batches to avoid a lock");
      RowLock rowLock = region.getRowLock(Bytes.toBytes("row_2"));

      MultithreadedTestUtil.TestContext ctx = new MultithreadedTestUtil.TestContext(CONF);
      final AtomicReference<OperationStatus[]> retFromThread = new AtomicReference<OperationStatus[]>();
      TestThread putter = new TestThread(ctx) {
        @Override
        public void doWork() throws IOException {
          retFromThread.set(region.batchMutate(puts));
        }
      };
      LOG.info("...starting put thread while holding lock");
      ctx.addThread(putter);
      ctx.startThreads();

      LOG.info("...waiting for put thread to sync first time");
      long startWait = System.currentTimeMillis();
      while (metricsAssertHelper.getCounter("syncTimeNumOps", source) == syncs + 2) {
        Thread.sleep(100);
        if (System.currentTimeMillis() - startWait > 10000) {
          fail("Timed out waiting for thread to sync first minibatch");
        }
      }
      LOG.info("...releasing row lock, which should let put thread continue");
      rowLock.release();
      LOG.info("...joining on thread");
      ctx.stop();
      LOG.info("...checking that next batch was synced");
      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 4, source);
      codes = retFromThread.get();
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.HRegion.RowLock

      }

      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 2, source);

      LOG.info("Next a batch put that has to break into two batches to avoid a lock");
      RowLock rowLock = region.getRowLock(Bytes.toBytes("row_2"));

      MultithreadedTestUtil.TestContext ctx = new MultithreadedTestUtil.TestContext(CONF);
      final AtomicReference<OperationStatus[]> retFromThread = new AtomicReference<OperationStatus[]>();
      TestThread putter = new TestThread(ctx) {
        @Override
        public void doWork() throws IOException {
          retFromThread.set(region.batchMutate(puts));
        }
      };
      LOG.info("...starting put thread while holding lock");
      ctx.addThread(putter);
      ctx.startThreads();

      LOG.info("...waiting for put thread to sync first time");
      long startWait = System.currentTimeMillis();
      while (metricsAssertHelper.getCounter("syncTimeNumOps", source) == syncs + 2) {
        Thread.sleep(100);
        if (System.currentTimeMillis() - startWait > 10000) {
          fail("Timed out waiting for thread to sync first minibatch");
        }
      }
      LOG.info("...releasing row lock, which should let put thread continue");
      rowLock.release();
      LOG.info("...joining on thread");
      ctx.stop();
      LOG.info("...checking that next batch was synced");
      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 4, source);
      codes = retFromThread.get();
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.HRegion.RowLock

      }

      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 2, source);

      LOG.info("Next a batch put that has to break into two batches to avoid a lock");
      RowLock rowLock = region.getRowLock(Bytes.toBytes("row_2"));

      MultithreadedTestUtil.TestContext ctx = new MultithreadedTestUtil.TestContext(CONF);
      final AtomicReference<OperationStatus[]> retFromThread = new AtomicReference<OperationStatus[]>();
      TestThread putter = new TestThread(ctx) {
        @Override
        public void doWork() throws IOException {
          retFromThread.set(region.batchMutate(puts));
        }
      };
      LOG.info("...starting put thread while holding lock");
      ctx.addThread(putter);
      ctx.startThreads();

      LOG.info("...waiting for put thread to sync first time");
      long startWait = System.currentTimeMillis();
      while (metricsAssertHelper.getCounter("syncTimeNumOps", source) == syncs + 2) {
        Thread.sleep(100);
        if (System.currentTimeMillis() - startWait > 10000) {
          fail("Timed out waiting for thread to sync first minibatch");
        }
      }
      LOG.info("...releasing row lock, which should let put thread continue");
      rowLock.release();
      LOG.info("...joining on thread");
      ctx.stop();
      LOG.info("...checking that next batch was synced");
      metricsAssertHelper.assertCounter("syncTimeNumOps", syncs + 4, source);
      codes = retFromThread.get();
View Full Code Here

Examples of org.hbase.async.RowLock

  }

  private static final class cas implements Cmd {
    public void execute(final HBaseClient client, String[] args) throws Exception {
      ensureArguments(args, 8, 8);
      RowLock lock = null;
      if (args[1].charAt(0) == 'l') {  // locked version of the command
        final RowLockRequest rlr = new RowLockRequest(args[2], args[3]);
        lock = client.lockRow(rlr).joinUninterruptibly();
        LOG.info("Acquired explicit row lock: " + lock);
      }
View Full Code Here

Examples of org.hbase.async.RowLock

            qualifiers[i - 5] = args[i].getBytes();
          }
          get.qualifiers(qualifiers);
        }
      }
      RowLock lock = null;
      if (args[1].charAt(0) == 'l') {  // locked version of the command
        final RowLockRequest rlr = new RowLockRequest(args[2], args[3]);
        lock = client.lockRow(rlr).joinUninterruptibly();
        LOG.info("Acquired explicit row lock: " + lock);
      }
View Full Code Here

Examples of org.hbase.async.RowLock

  }

  private static final class put implements Cmd {
    public void execute(final HBaseClient client, String[] args) throws Exception {
      ensureArguments(args, 7, 7);
      RowLock lock = null;
      if (args[1].charAt(0) == 'l') {  // locked version of the command
        final RowLockRequest rlr = new RowLockRequest(args[2], args[3]);
        lock = client.lockRow(rlr).joinUninterruptibly();
        LOG.info("Acquired explicit row lock: " + lock);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.