NamespaceInfo getNamespaceInfo() { readLock(); try { return bpNSInfo; } finally { readUnlock(); } }
/** * @return a proxy to the active NN, or null if the BPOS has not * acknowledged any NN as active yet. */ DatanodeProtocolClientSideTranslatorPB getActiveNN() { readLock(); try { if (bpServiceToActive != null) { return bpServiceToActive.bpNamenode; } else { return null; } } finally { readUnlock(); } }
String getBlockPoolId(boolean quiet) { // avoid lock contention unless the registration hasn't completed. String id = bpId; if (id != null) { return id; } readLock(); try { if (bpNSInfo != null) { return bpNSInfo.getBlockPoolID(); } else { if (!quiet) { LOG.warn("Block pool ID needed, but service not yet registered with " + "NN, trace:", new Exception()); } return null; } } finally { readUnlock(); } }
@Override public String toString() { readLock(); try { if (bpNSInfo == null) { // If we haven't yet connected to our NN, we don't yet know our // own block pool ID. // If _none_ of the block pools have connected yet, we don't even // know the DatanodeID ID of this DN. String datanodeUuid = dn.getDatanodeUuid(); if (datanodeUuid == null || datanodeUuid.isEmpty()) { datanodeUuid = "unassigned"; } return "Block pool <registering> (Datanode Uuid " + datanodeUuid + ")"; } else { return "Block pool " + getBlockPoolId() + " (Datanode Uuid " + dn.getDatanodeUuid() + ")"; } } finally { readUnlock(); } }
NamespaceInfo getNamespaceInfo() { readLock(); try { return bpNSInfo; } finally { readUnlock(); } }
NamespaceInfo getNamespaceInfo() { readLock(); try { return bpNSInfo; } finally { readUnlock(); } }
/** * @return a proxy to the active NN, or null if the BPOS has not * acknowledged any NN as active yet. */ DatanodeProtocolClientSideTranslatorPB getActiveNN() { readLock(); try { if (bpServiceToActive != null) { return bpServiceToActive.bpNamenode; } else { return null; } } finally { readUnlock(); } }
/** * @return a proxy to the active NN, or null if the BPOS has not * acknowledged any NN as active yet. */ DatanodeProtocolClientSideTranslatorPB getActiveNN() { readLock(); try { if (bpServiceToActive != null) { return bpServiceToActive.bpNamenode; } else { return null; } } finally { readUnlock(); } }
String getBlockPoolId() { readLock(); try { if (bpNSInfo != null) { return bpNSInfo.getBlockPoolID(); } else { LOG.warn("Block pool ID needed, but service not yet registered with NN", new Exception("trace")); return null; } } finally { readUnlock(); } }
String getBlockPoolId() { readLock(); try { if (bpNSInfo != null) { return bpNSInfo.getBlockPoolID(); } else { LOG.warn("Block pool ID needed, but service not yet registered with NN", new Exception("trace")); return null; } } finally { readUnlock(); } }
@Override public String toString() { readLock(); try { if (bpNSInfo == null) { // If we haven't yet connected to our NN, we don't yet know our // own block pool ID. // If _none_ of the block pools have connected yet, we don't even // know the DatanodeID ID of this DN. String datanodeUuid = dn.getDatanodeUuid(); if (datanodeUuid == null || datanodeUuid.isEmpty()) { datanodeUuid = "unassigned"; } return "Block pool <registering> (Datanode Uuid " + datanodeUuid + ")"; } else { return "Block pool " + getBlockPoolId() + " (Datanode Uuid " + dn.getDatanodeUuid() + ")"; } } finally { readUnlock(); } }
@Override public String toString() { readLock(); try { if (bpNSInfo == null) { // If we haven't yet connected to our NN, we don't yet know our // own block pool ID. // If _none_ of the block pools have connected yet, we don't even // know the DatanodeID ID of this DN. String datanodeUuid = dn.getDatanodeUuid(); if (datanodeUuid == null || datanodeUuid.isEmpty()) { datanodeUuid = "unassigned"; } return "Block pool <registering> (Datanode Uuid " + datanodeUuid + ")"; } else { return "Block pool " + getBlockPoolId() + " (Datanode Uuid " + dn.getDatanodeUuid() + ")"; } } finally { readUnlock(); } }