Examples of writeLock()


Examples of org.apache.hadoop.hbase.master.TableLockManager.writeLock()

    ServerName mockName = new ServerName("localhost", 60000, 1);

    // obtain one lock
    final TableLockManager tableLockManager = TableLockManager.createTableLockManager(conf, TEST_UTIL.getZooKeeperWatcher(), mockName);
    TableLock writeLock = tableLockManager.writeLock(TableName.valueOf("foo"),
        "testCheckTableLocks");
    writeLock.acquire();
    hbck = doFsck(conf, false);
    assertNoErrors(hbck); // should not have expired, no problems
View Full Code Here

Examples of org.apache.hadoop.hbase.master.TableLockManager.writeLock()

    final CountDownLatch latch = new CountDownLatch(1);
    new Thread() {
      @Override
      public void run() {
        TableLock readLock = tableLockManager.writeLock(TableName.valueOf("foo"),
            "testCheckTableLocks");
        try {
          latch.countDown();
          readLock.acquire();
        } catch (IOException ex) {
View Full Code Here

Examples of org.apache.hadoop.hbase.master.TableLockManager.writeLock()

    hbck = doFsck(conf, false);
    assertNoErrors(hbck);

    // ensure that locks are deleted
    writeLock = tableLockManager.writeLock(TableName.valueOf("foo"),
        "should acquire without blocking");
    writeLock.acquire(); // this should not block.
    writeLock.release(); // release for clean state
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.lock.ZKInterProcessReadWriteLock.writeLock()

      for (String tableName : getTableNames()) {
        String tableLockZNode = ZKUtil.joinZNode(zkWatcher.tableLockZNode, tableName);
        ZKInterProcessReadWriteLock lock = new ZKInterProcessReadWriteLock(
            zkWatcher, tableLockZNode, null);
        lock.readLock(null).visitLocks(handler);
        lock.writeLock(null).visitLocks(handler);
      }
    }

    private List<String> getTableNames() throws IOException {
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.FSNamesystem.writeLock()

   * @param nn the NameNode to manipulate
   * @param dnName the name of the DataNode
   */
  public static void noticeDeadDatanode(NameNode nn, String dnName) {
    FSNamesystem namesystem = nn.getNamesystem();
    namesystem.writeLock();
    try {
      DatanodeManager dnm = namesystem.getBlockManager().getDatanodeManager();
      HeartbeatManager hbm = dnm.getHeartbeatManager();
      DatanodeDescriptor[] dnds = hbm.getDatanodes();
      DatanodeDescriptor theDND = null;
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.FSNamesystem.writeLock()

      final int MAX_INVALIDATE_BLOCKS = 2*MAX_INVALIDATE_LIMIT+REMAINING_BLOCKS;
      final int MAX_REPLICATE_BLOCKS = 2*MAX_REPLICATE_LIMIT+REMAINING_BLOCKS;
      final DatanodeStorageInfo[] ONE_TARGET = {dd.getStorageInfo(storageID)};

      try {
        namesystem.writeLock();
        synchronized(hm) {
          for (int i=0; i<MAX_REPLICATE_BLOCKS; i++) {
            dd.addBlockToBeReplicated(
                new Block(i, 0, GenerationStamp.LAST_RESERVED_STAMP),
                ONE_TARGET);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.FSNamesystem.writeLock()

        DataNodeTestUtils.getDNRegistrationForBP(cluster.getDataNodes().get(2), poolId);
      final DatanodeDescriptor dd3 = NameNodeAdapter.getDatanode(namesystem, nodeReg3);
      dd3.updateStorage(new DatanodeStorage(DatanodeStorage.generateUuid()));

      try {
        namesystem.writeLock();
        synchronized(hm) {
          NameNodeAdapter.sendHeartBeat(nodeReg1, dd1, namesystem);
          NameNodeAdapter.sendHeartBeat(nodeReg2, dd2, namesystem);
          NameNodeAdapter.sendHeartBeat(nodeReg3, dd3, namesystem);
View Full Code Here

Examples of org.apache.ojb.odmg.locking.LockManager.writeLock()

                }
            }
            else if (lockMode == Transaction.WRITE)
            {
                if (log.isDebugEnabled()) log.debug("Do WRITE lock on object: " + oid);
                if(!lm.writeLock(this, oid, obj))
                {
                    throw new LockNotGrantedException("Can not lock for WRITE: " + oid);
                }
            }
            else if (lockMode == Transaction.UPGRADE)
View Full Code Here

Examples of org.apache.ojb.otm.lock.isolation.TransactionIsolation.writeLock()

        {
            isolation.readLock(tx, objectLock);
        }
        else if (lock == LockType.WRITE_LOCK)
        {
            isolation.writeLock(tx, objectLock);
        }
    }

    public int getLockHeld(Identity oid, Transaction tx)
    {
View Full Code Here

Examples of org.apache.openjpa.datacache.QueryCache.writeLock()

     */
    public void testWriteLock() throws Exception {
        final QueryCache qc = emf.getConfiguration().getDataCacheManagerInstance().getSystemQueryCache();
        Thread t2 = new Thread() {
            public void run() {
                qc.writeLock();
                qc.writeUnlock();
            }
        };
        t2.start();
        t2.join(5000);
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.