@Override public long getJournalCTime() throws IOException { StorageInfo sInfo = new StorageInfo((NodeType)null); sInfo.readProperties(sd); return sInfo.getCTime(); } }
public static StorageInfo convert(StorageInfoProto info, NodeType type) { return new StorageInfo(info.getLayoutVersion(), info.getNamespceID(), info.getClusterID(), info.getCTime(), type); }
/** * Create DatanodeRegistration */ public DatanodeRegistration(String nodeName) { super(nodeName); this.storageInfo = new StorageInfo(); }
/** * Create a DatanodeRegistration for a specific block pool. * @param nsInfo the namespace info from the first part of the NN handshake */ DatanodeRegistration createBPRegistration(NamespaceInfo nsInfo) { StorageInfo storageInfo = storage.getBPStorage(nsInfo.getBlockPoolID()); if (storageInfo == null) { // it's null in the case of SimulatedDataSet storageInfo = new StorageInfo( DataNodeLayoutVersion.CURRENT_LAYOUT_VERSION, nsInfo.getNamespaceID(), nsInfo.clusterID, nsInfo.getCTime(), NodeType.DATA_NODE); } DatanodeID dnId = new DatanodeID( streamingAddr.getAddress().getHostAddress(), hostName, storage.getDatanodeUuid(), getXferPort(), getInfoPort(), infoSecurePort, getIpcPort()); return new DatanodeRegistration(dnId, storageInfo, new ExportedBlockKeys(), VersionInfo.getVersion()); }
public void setStorageInfo(StorageInfo storage, String storageID) { this.storageInfo = new StorageInfo(storage); this.storageID = storageID; }
/** * Create DatanodeRegistration */ public DatanodeRegistration(String nodeName) { super(nodeName); this.storageInfo = new StorageInfo(); }
StorageData(int layoutVersion, int namespaceId, String clusterId, long cTime, String bpid) { storageInfo = new StorageInfo(layoutVersion, namespaceId, clusterId, cTime, NodeType.DATA_NODE); blockPoolId = bpid; } }
public void setStorageInfo(DataStorage storage) { this.storageInfo = new StorageInfo(storage); this.storageID = storage.getStorageID(); }
new StorageInfo(layoutVersionOld, namespaceIdCur, fsscTimeOld), // 0 new StorageInfo(layoutVersionOld, namespaceIdCur, fsscTimeCur), // 1 new StorageInfo(layoutVersionOld, namespaceIdCur, fsscTimeNew), // 2 new StorageInfo(layoutVersionOld, namespaceIdOld, fsscTimeOld), // 3 new StorageInfo(layoutVersionOld, namespaceIdOld, fsscTimeCur), // 4 new StorageInfo(layoutVersionOld, namespaceIdOld, fsscTimeNew), // 5 new StorageInfo(layoutVersionCur, namespaceIdCur, fsscTimeOld), // 6 new StorageInfo(layoutVersionCur, namespaceIdCur, fsscTimeCur), // 7 new StorageInfo(layoutVersionCur, namespaceIdCur, fsscTimeNew), // 8 new StorageInfo(layoutVersionCur, namespaceIdOld, fsscTimeOld), // 9
private static StorageInfo getStorageInfo(NodeType type) { return new StorageInfo(1, 2, "cid", 3, type); }
@Override public long getJournalCTime() throws IOException { StorageInfo sInfo = new StorageInfo((NodeType)null); sInfo.readProperties(sd); return sInfo.getCTime(); } }
@Override public long getJournalCTime() throws IOException { StorageInfo sInfo = new StorageInfo((NodeType)null); sInfo.readProperties(sd); return sInfo.getCTime(); } }
public static StorageInfo convert(StorageInfoProto info, NodeType type) { return new StorageInfo(info.getLayoutVersion(), info.getNamespceID(), info.getClusterID(), info.getCTime(), type); }
public static StorageInfo convert(StorageInfoProto info, NodeType type) { return new StorageInfo(info.getLayoutVersion(), info.getNamespceID(), info.getClusterID(), info.getCTime(), type); }
public static DatanodeRegistration getLocalDatanodeRegistration() { return new DatanodeRegistration(getLocalDatanodeID(), new StorageInfo( NodeType.DATA_NODE), new ExportedBlockKeys(), VersionInfo.getVersion()); }
/** * Create a DatanodeRegistration for a specific block pool. * @param nsInfo the namespace info from the first part of the NN handshake */ DatanodeRegistration createBPRegistration(NamespaceInfo nsInfo) { StorageInfo storageInfo = storage.getBPStorage(nsInfo.getBlockPoolID()); if (storageInfo == null) { // it's null in the case of SimulatedDataSet storageInfo = new StorageInfo( DataNodeLayoutVersion.CURRENT_LAYOUT_VERSION, nsInfo.getNamespaceID(), nsInfo.clusterID, nsInfo.getCTime(), NodeType.DATA_NODE); } DatanodeID dnId = new DatanodeID( streamingAddr.getAddress().getHostAddress(), hostName, storage.getDatanodeUuid(), getXferPort(), getInfoPort(), infoSecurePort, getIpcPort()); return new DatanodeRegistration(dnId, storageInfo, new ExportedBlockKeys(), VersionInfo.getVersion()); }
/** * Create a DatanodeRegistration for a specific block pool. * @param nsInfo the namespace info from the first part of the NN handshake */ DatanodeRegistration createBPRegistration(NamespaceInfo nsInfo) { StorageInfo storageInfo = storage.getBPStorage(nsInfo.getBlockPoolID()); if (storageInfo == null) { // it's null in the case of SimulatedDataSet storageInfo = new StorageInfo( DataNodeLayoutVersion.CURRENT_LAYOUT_VERSION, nsInfo.getNamespaceID(), nsInfo.clusterID, nsInfo.getCTime(), NodeType.DATA_NODE); } DatanodeID dnId = new DatanodeID( streamingAddr.getAddress().getHostAddress(), hostName, storage.getDatanodeUuid(), getXferPort(), getInfoPort(), infoSecurePort, getIpcPort()); return new DatanodeRegistration(dnId, storageInfo, new ExportedBlockKeys(), VersionInfo.getVersion()); }
new StorageInfo(NodeType.DATA_NODE), new ExportedBlockKeys(), VersionInfo.getVersion()); dnrList.add(dnr);
@Test public void testConvertDatanodeRegistration() { DatanodeID dnId = DFSTestUtil.getLocalDatanodeID(); BlockKey[] keys = new BlockKey[] { getBlockKey(2), getBlockKey(3) }; ExportedBlockKeys expKeys = new ExportedBlockKeys(true, 9, 10, getBlockKey(1), keys); DatanodeRegistration reg = new DatanodeRegistration(dnId, new StorageInfo(NodeType.DATA_NODE), expKeys, "3.0.0"); DatanodeRegistrationProto proto = PBHelper.convert(reg); DatanodeRegistration reg2 = PBHelper.convert(proto); compare(reg.getStorageInfo(), reg2.getStorageInfo()); compare(reg.getExportedKeys(), reg2.getExportedKeys()); compare(reg, reg2); assertEquals(reg.getSoftwareVersion(), reg2.getSoftwareVersion()); }
DatanodeRegistration reg = new DatanodeRegistration( new DatanodeID(UUID.randomUUID().toString(), did), new StorageInfo(HdfsServerConstants.NodeType.DATA_NODE), new ExportedBlockKeys(), VersionInfo.getVersion());