Gets the metadata of a temp block.

@param blockId the id of the temp block
@return metadata of the block or null
330328
public TempBlockMeta getTempBlockMetaOrNull(long blockId) {
    for (StorageTier tier : mTiers) {
      for (StorageDir dir : tier.getStorageDirs()) {
        if (dir.hasTempBlockMeta(blockId)) {
          return dir.getTempBlockMeta(blockId);
        }
      }
    }
    return null;
  }
1006977
public Metadata getMetadata() throws DBException {
        if (!this.cluster.isClosed()) {
            this.metadata = cluster.getMetadata();
            return this.metadata;
        } else {
            throw new DBException("The cluster has been closed");
        }
    }
1025161
File getValidateBlockFile(int namespaceId, Block b, boolean checkSize)
      throws IOException {
    //Should we check for metadata file too?
    DatanodeBlockInfo blockInfo = this.getDatanodeBlockInfo(namespaceId, b);
    File f = null;
    if (blockInfo != null) {
      if (checkSize) {
        blockInfo.verifyFinalizedSize();
      }
      f = blockInfo.getBlockDataFile().getFile();
      assert f != null;

      if(f.exists()) {
        return f;
      }
   
      // if file is not null, but doesn't exist - possibly disk failed
      datanode.checkDiskError();
    }
    
    if (InterDatanodeProtocol.LOG.isDebugEnabled()) {
      InterDatanodeProtocol.LOG.debug("b=" + b + ", f=" + ((f == null) ? "null"
          : f));
    }
    return null;
  }
99789
public BlockMeta getBlockMeta(long blockId) throws BlockDoesNotExistException {
    for (StorageTier tier : mTiers) {
      for (StorageDir dir : tier.getStorageDirs()) {
        if (dir.hasBlockMeta(blockId)) {
          return dir.getBlockMeta(blockId);
        }
      }
    }
    throw new BlockDoesNotExistException(ExceptionMessage.BLOCK_META_NOT_FOUND, blockId);
  }
466361
@Override
  public Collection<Block> getByResourceId(String resourceId) {
    ensureSorted();

    // prepare resourceId for binary search
    resourceIds[size] = resourceId;
    resourceIdsIndex[size] = size;

    int index = DataUtils.binarySearch(byResourceId);

    List<Block> result = new ArrayList<>();
    int realIndex = resourceIdsIndex[index];
    while (index < size && FastStringComparator.INSTANCE.compare(resourceIds[realIndex], resourceId) == 0) {
      result.add(getBlock(realIndex, resourceId));

      index++;
      realIndex = resourceIdsIndex[index];
    }
    return result;
  }
482191
BlocksWithLocations getBlocks(DatanodeID datanode, long size)
    throws IOException {
    readLock();
    try {
      checkSuperuserPrivilege();

      DatanodeDescriptor node = getDatanode(datanode);
      if (node == null) {
        NameNode.stateChangeLog.warn("BLOCK* NameSystem.getBlocks: "
          + "Asking for blocks from an unrecorded node " + datanode.getName());
        throw new IllegalArgumentException(
          "Unexpected exception.  Got getBlocks message for datanode " +
            datanode.getName() + ", but there is no info for it");
      }

      int numBlocks = node.numBlocks();
      if (numBlocks == 0) {
        return new BlocksWithLocations(new BlockWithLocations[0]);
      }
      Iterator<BlockInfo> iter = node.getBlockIterator();
      int startBlock = r.nextInt(numBlocks); // starting from a random block
      // skip blocks
      for (int i = 0; i < startBlock; i++) {
        iter.next();
      }
      List<BlockWithLocations> results = new ArrayList<BlockWithLocations>();
      long totalSize = 0;
      while (totalSize < size && iter.hasNext()) {
        totalSize += addBlock(iter.next(), results);
      }
      if (totalSize < size) {
        iter = node.getBlockIterator(); // start from the beginning
        for (int i = 0; i < startBlock && totalSize < size; i++) {
          totalSize += addBlock(iter.next(), results);
        }
      }

      return new BlocksWithLocations(
        results.toArray(new BlockWithLocations[results.size()]));
    } finally {
      readUnlock();
    }
  }
1028493
public Metadata getMetadata(String templateName) {
        String scope = Metadata.scopeBasedOnType(templateName);
        return this.getMetadata(templateName, scope);
    }
1338146
protected String getArtifactId(String artifactId) {
        return this.artifactId == null || this.artifactId.length() == 0
                ? artifactId
                : this.artifactId;
    }
931883
def get_atlas_zonefile_info_at( self, block_id ):
        
        nameops = self.get_all_blockstack_ops_at( block_id )
        ret = []
        for nameop in nameops:
            if nameop.has_key('op') and op_get_opcode_name(nameop['op']) in ['NAME_UPDATE', 'NAME_IMPORT', 'NAME_REGISTRATION', 'NAME_RENEWAL']:

                assert nameop.has_key('value_hash')
                assert nameop.has_key('name')
                assert nameop.has_key('txid')

                if nameop['value_hash'] is not None:
                    ret.append( {'name': nameop['name'], 'value_hash': nameop['value_hash'], 'txid': nameop['txid']} )

        return ret
1325021
public Cluster getCluster(final ClusterId clusterId) {
        for(final Cluster cur: clusters)
            if(cur.getClusterId().equals(clusterId))
                return cur;
        return null;
    }
1179110
public ManagedBuffer getBlockData(
      String appId,
      String execId,
      int shuffleId,
      int mapId,
      int reduceId) {
    ExecutorShuffleInfo executor = executors.get(new AppExecId(appId, execId));
    if (executor == null) {
      throw new RuntimeException(
        String.format("Executor is not registered (appId=%s, execId=%s)", appId, execId));
    }
    return getSortBasedShuffleBlockData(executor, shuffleId, mapId, reduceId);
  }
1133458
@SuppressWarnings("unchecked")
    @Override
    public V get(Block<?, ?> block) {
        return (V) storage[block.getId()];
    }
1040535
public DatanodeDescriptor getDatanode(DatanodeID nodeID) throws IOException {
    UnregisteredDatanodeException e = null;
    DatanodeDescriptor node = datanodeMap.get(nodeID.getStorageID());
    if (node == null) {
      return null;
    }
    if (!node.getName().equals(nodeID.getName())) {
      e = new UnregisteredDatanodeException(nodeID, node);
      NameNode.stateChangeLog.fatal("BLOCK* NameSystem.getDatanode: "
        + e.getLocalizedMessage());
      throw e;
    }
    return node;
  }
339497
public alluxio.grpc.BlockMasterInfo getBlockMasterInfo() {
    return blockMasterInfo_ == null ? alluxio.grpc.BlockMasterInfo.getDefaultInstance() : blockMasterInfo_;
  }
544232
public boolean isBlockMarked(long blockId) {
    for (StorageTierView tierView : mTierViews) {
      for (StorageDirView dirView : tierView.getDirViews()) {
        if (dirView.isMarkedToMoveOut(blockId)) {
          return true;
        }
      }
    }
    return false;
  }
795635
public static LargeBlockTask getReleaseTask(BlockId blockId) {
        return new LargeBlockTask() {
            @Override
            public LargeBlockResponse call() throws Exception {
                Exception theException = null;
                try {
                    LargeBlockManager.getInstance().releaseBlock(blockId);
                }
                catch (Exception exc) {
                    theException = exc;
                }

                return new LargeBlockResponse(theException);
            }
        };
    }
1077077
public static MetadataTemplate getMetadataTemplateByID(BoxAPIConnection api, String templateID) {

        URL url = METADATA_TEMPLATE_BY_ID_URL_TEMPLATE.build(api.getBaseURL(), templateID);
        BoxAPIRequest request = new BoxAPIRequest(api, url, "GET");
        BoxJSONResponse response = (BoxJSONResponse) request.send();
        return new MetadataTemplate(response.getJSON());
    }