Examples of readLock()


Examples of org.apache.hadoop.hbase.InterProcessReadWriteLock.readLock()

          .setCreateTime(EnvironmentEdgeManager.currentTimeMillis()).build();
        byte[] lockMetadata = toBytes(data);

        InterProcessReadWriteLock lock = new ZKInterProcessReadWriteLock(zkWatcher, tableLockZNode,
          METADATA_HANDLER);
        return isShared ? lock.readLock(lockMetadata) : lock.writeLock(lockMetadata);
      }
    }

    private static byte[] toBytes(ZooKeeperProtos.TableLock data) {
      return ProtobufUtil.prependPBMagic(data.toByteArray());
View Full Code Here

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

    public void visitAllLocks(MetadataHandler handler) throws IOException {
      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.readLock()

      BlockLocation locs[] = fs.getFileBlockLocations(
          fs.getFileStatus(fileName), 0, Long.MAX_VALUE);

      // All replicas for deletion should be scheduled on lastDN.
      // And should not actually be deleted, because lastDN does not heartbeat.
      namesystem.readLock();
      Collection<Block> dnBlocks =
        namesystem.getBlockManager().excessReplicateMap.get(lastDNid);
      assertEquals("Replicas on node " + lastDNid + " should have been deleted",
          SMALL_FILE_LENGTH / SMALL_BLOCK_SIZE, dnBlocks.size());
      namesystem.readUnlock();
View Full Code Here

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

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

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

        isolation = IsolationFactory.getIsolationLevel(pb, objectLock);

        if (lock == LockType.READ_LOCK)
        {
            isolation.readLock(tx, objectLock);
        }
        else if (lock == LockType.WRITE_LOCK)
        {
            isolation.writeLock(tx, objectLock);
        }
View Full Code Here

Examples of org.drools.common.InternalRuleBase.readLock()

    }

    public static ObjectTypeNode attachObjectTypeNode(BuildContext context,
                                                      ObjectType objectType) {
        final InternalRuleBase ruleBase = context.getRuleBase();
        ruleBase.readLock();
        try {
            InternalWorkingMemory[] wms = context.getWorkingMemories();

            EntryPointNode epn = ruleBase.getRete().getEntryPointNode( context.getCurrentEntryPoint() );
            if ( epn == null ) {
View Full Code Here

Examples of org.fife.ui.rsyntaxtextarea.RSyntaxDocument.readLock()

      String selectedText = this.textArea.getSelectedText();
      // If text is selected just use that, otherwise select the nearest token.
      if (selectedText == null)
      {
         RSyntaxDocument doc = (RSyntaxDocument) textArea.getDocument();
         doc.readLock();
         try
         {
            // Get the token at the caret position.
            int line = textArea.getCaretLineNumber();
            Token tokenList = textArea.getTokenListForLine(line);
View Full Code Here

Examples of org.geotools.caching.spatialindex.NodeIdentifier.readLock()

                logger.log(Level.SEVERE, "Could not acquire necessary write locks.", ex);
                continue;
            }
            if (nodeid.isValid()) {
                // might have been validated by previous thread; so lets make sure we have the correct queue
                nodeid.readLock();
                found.add(nodeid);
                nodeid.writeUnLock();
                iterator.remove();
            }
        }
View Full Code Here

Examples of org.gephi.graph.api.Graph.readLock()

                if (idColumn != null) {
                    id = reader.get(idColumn);
                    if (id == null || id.isEmpty()) {
                        node = gec.createNode(null);//id null or empty, assign one
                    } else {
                        graph.readLock();
                        node = graph.getNode(id);
                        graph.readUnlock();
                        if (node != null) {//Node with that id already in graph
                            if (assignNewNodeIds) {
                                node = gec.createNode(null);
View Full Code Here

Examples of org.gephi.graph.api.Graph.readLock()

                if (sourceId == null || sourceId.isEmpty() || targetId == null || targetId.isEmpty()) {
                    continue;//No correct source and target ids were provided, ignore row
                }

                graph.readLock();
                source = graph.getNode(sourceId);
                graph.readUnlock();

                if (source == null) {
                    if (createNewNodes) {//Create new nodes when they don't exist already and option is enabled
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.