FSNamesystem implements Namesystem, FSNamesystemMBean,
    NameNodeMXBean, ReplicatedBlocksMBean, ECBlockGroupsMBean { public static List<URI> getNamespaceEditsDirs(Configuration conf) throws IOException { return getNamespaceEditsDirs(conf, true); } FSNamesystem(Configuration conf, FSImage fsImage);   FSNamesystem(Configuration conf, FSImage fsImage, boolean ignoreRetryCache); @VisibleForTesting long getLazyPersistFileScrubberTS(); boolean isHaEnabled(); @VisibleForTesting List<AuditLogger> getAuditLoggers(); @VisibleForTesting RetryCache getRetryCache(); @VisibleForTesting long getLeaseRecheckIntervalMs(); @VisibleForTesting long getMaxLockHoldToReleaseLeaseMs(); int getMaxListOpenFilesResponses(); @VisibleForTesting KeyProviderCryptoExtension getProvider(); @Override void startSecretManagerIfNecessary(); @Override boolean inTransitionToActive(); void checkOperation(OperationCategory op); static Collection<URI> getNamespaceDirs(Configuration conf); static Collection<URI> getRequiredNamespaceEditsDirs(Configuration conf); static List<URI> getNamespaceEditsDirs(Configuration conf); static List<URI> getNamespaceEditsDirs(Configuration conf,
      boolean includeShared); static List<URI> getSharedEditsDirs(Configuration conf); @Override void readLock(); @Override void readLockInterruptibly(); @Override void readUnlock(); void readUnlock(String opName); void readUnlock(String opName,
      Supplier<String> lockReportInfoSupplier); @Override void writeLock(); @Override void writeLockInterruptibly(); @Override void writeUnlock(); void writeUnlock(String opName); void writeUnlock(String opName, boolean suppressWriteLockReport); void writeUnlock(String opName,
      Supplier<String> lockReportInfoSupplier); @Override boolean hasWriteLock(); @Override boolean hasReadLock(); int getReadHoldCount(); int getWriteHoldCount(); void cpLock(); void cpLockInterruptibly(); void cpUnlock(); @Override boolean isRunning(); boolean isInStandbyState(); BlocksWithLocations getBlocks(DatanodeID datanode, long size, long
      minimumBlockSize); BatchedListEntries<OpenFileEntry> getFilesBlockingDecom(long prevId,
      String path); @VisibleForTesting FsServerDefaults getServerDefaults(); @Override boolean isInSnapshot(long blockCollectionID); @Override INodeFile getBlockCollection(long id); byte[] getSrcPathsHash(String[] srcs); FSImage getFSImage(); FSEditLog getEditLog(); @Metric({"MissingBlocks", "Number of missing blocks"}) long getMissingBlocksCount(); @Metric({"MissingReplOneBlocks", "Number of missing blocks " + "with replication factor 1"}) long getMissingReplOneBlocksCount(); @Metric({"ExpiredHeartbeats", "Number of expired heartbeats"}) int getExpiredHeartbeats(); @Metric({"TransactionsSinceLastCheckpoint", "Number of transactions since last checkpoint"}) long getTransactionsSinceLastCheckpoint(); @Metric({"TransactionsSinceLastLogRoll", "Number of transactions since last edit log roll"}) long getTransactionsSinceLastLogRoll(); @Metric({"LastWrittenTransactionId", "Transaction ID written to the edit log"}) long getLastWrittenTransactionId(); @Metric({"LastCheckpointTime", "Time in milliseconds since the epoch of the last checkpoint"}) long getLastCheckpointTime(); @Override // FSNamesystemMBean @Metric({"CapacityTotal", "Total raw capacity of data nodes in bytes"}) long getCapacityTotal(); @Metric({"CapacityTotalGB", "Total raw capacity of data nodes in GB"}) float getCapacityTotalGB(); @Override // FSNamesystemMBean @Metric({"CapacityUsed", "Total used capacity across all data nodes in bytes"}) long getCapacityUsed(); @Metric({"CapacityUsedGB", "Total used capacity across all data nodes in GB"}) float getCapacityUsedGB(); @Override // FSNamesystemMBean @Metric({"CapacityRemaining", "Remaining capacity in bytes"}) long getCapacityRemaining(); @Override // FSNamesystemMBean @Metric({"ProvidedCapacityTotal", "Total space used in PROVIDED storage in bytes" }) long getProvidedCapacityTotal(); @Metric({"CapacityRemainingGB", "Remaining capacity in GB"}) float getCapacityRemainingGB(); @Metric({"CapacityUsedNonDFS", "Total space used by data nodes for non DFS purposes in bytes"}) long getCapacityUsedNonDFS(); @Override // FSNamesystemMBean @Metric int getTotalLoad(); @Metric({ "SnapshottableDirectories", "Number of snapshottable directories" }) int getNumSnapshottableDirs(); @Metric({ "Snapshots", "The number of snapshots" }) int getNumSnapshots(); @Override String getSnapshotStats(); @Override // FSNamesystemMBean @Metric({ "NumEncryptionZones", "The number of encryption zones" }) int getNumEncryptionZones(); @Override // FSNamesystemMBean @Metric({ "CurrentTokensCount", "The number of delegation tokens"}) long getCurrentTokensCount(); @Override @Metric({"LockQueueLength", "Number of threads waiting to " + "acquire FSNameSystemLock"}) int getFsLockQueueLength(); @Override // FSNamesystemMBean @Metric long getBlocksTotal(); @Metric({ "NumFilesUnderConstruction", "Number of files under construction" }) long getNumFilesUnderConstruction(); @Metric({ "NumActiveClients", "Number of active clients holding lease" }) long getNumActiveClients(); long getCompleteBlocksTotal(); @Override boolean isInSafeMode(); @Override boolean isInStartupSafeMode(); void processIncrementalBlockReport(final DatanodeID nodeID,
      final StorageReceivedDeletedBlocks srdb); @Override // FSNamesystemMBean long getMaxObjects(); @Override // FSNamesystemMBean @Metric long getFilesTotal(); @Override // FSNamesystemMBean @Metric @Deprecated long getPendingReplicationBlocks(); @Override // FSNamesystemMBean @Metric long getPendingReconstructionBlocks(); @Override // FSNamesystemMBean @Metric @Deprecated long getUnderReplicatedBlocks(); @Override // FSNamesystemMBean @Metric long getLowRedundancyBlocks(); @Metric({"CorruptBlocks", "Number of blocks with corrupt replicas"}) long getCorruptReplicaBlocks(); @Override // FSNamesystemMBean @Metric long getScheduledReplicationBlocks(); @Override @Metric long getPendingDeletionBlocks(); @Override // ReplicatedBlocksMBean @Metric({"LowRedundancyReplicatedBlocks", "Number of low redundancy replicated blocks"}) long getLowRedundancyReplicatedBlocks(); @Override // ReplicatedBlocksMBean @Metric({"CorruptReplicatedBlocks", "Number of corrupted replicated blocks"}) long getCorruptReplicatedBlocks(); @Override // ReplicatedBlocksMBean @Metric({"MissingReplicatedBlocks", "Number of missing replicated blocks"}) long getMissingReplicatedBlocks(); @Override // ReplicatedBlocksMBean @Metric({"MissingReplicationOneBlocks", "Number of missing replicated " + "blocks with replication factor 1"}) long getMissingReplicationOneBlocks(); @Override // ReplicatedBlocksMBean @Metric({"HighestPriorityLowRedundancyReplicatedBlocks", "Number of " + "replicated blocks which have the highest risk of loss."}) long getHighestPriorityLowRedundancyReplicatedBlocks(); @Override // ReplicatedBlocksMBean @Metric({"HighestPriorityLowRedundancyECBlocks", "Number of erasure coded " + "blocks which have the highest risk of loss."}) long getHighestPriorityLowRedundancyECBlocks(); @Override // ReplicatedBlocksMBean @Metric({"BytesInFutureReplicatedBlocks", "Total bytes in replicated " + "blocks with future generation stamp"}) long getBytesInFutureReplicatedBlocks(); @Override // ReplicatedBlocksMBean @Metric({"PendingDeletionReplicatedBlocks", "Number of replicated blocks " + "that are pending deletion"}) long getPendingDeletionReplicatedBlocks(); @Override // ReplicatedBlocksMBean @Metric({"TotalReplicatedBlocks", "Total number of replicated blocks"}) long getTotalReplicatedBlocks(); @Override // ECBlockGroupsMBean @Metric({"LowRedundancyECBlockGroups", "Number of erasure coded block " + "groups with low redundancy"}) long getLowRedundancyECBlockGroups(); @Override // ECBlockGroupsMBean @Metric({"CorruptECBlockGroups", "Number of erasure coded block groups that" + " are corrupt"}) long getCorruptECBlockGroups(); @Override // ECBlockGroupsMBean @Metric({"MissingECBlockGroups", "Number of erasure coded block groups that" + " are missing"}) long getMissingECBlockGroups(); @Override // ECBlockGroupsMBean @Metric({"BytesInFutureECBlockGroups", "Total bytes in erasure coded block " + "groups with future generation stamp"}) long getBytesInFutureECBlockGroups(); @Override // ECBlockGroupsMBean @Metric({"PendingDeletionECBlocks", "Number of erasure coded blocks " + "that are pending deletion"}) long getPendingDeletionECBlocks(); @Override // ECBlockGroupsMBean @Metric({"TotalECBlockGroups", "Total number of erasure coded block groups"}) long getTotalECBlockGroups(); @Override // ECBlockGroupsMBean @Metric({"EnabledEcPolicies", "Enabled erasure coding policies"}) String getEnabledEcPolicies(); @Override long getBlockDeletionStartTime(); @Metric long getExcessBlocks(); @Metric long getNumTimedOutPendingReconstructions(); @Metric long getPostponedMisreplicatedBlocks(); @Metric int getPendingDataNodeMessageCount(); @Metric String getHAState(); @Metric long getMillisSinceLastLoadedEdits(); @Metric int getBlockCapacity(); HAServiceState getState(); @Override // FSNamesystemMBean String getFSState(); @Override // FSNamesystemMBean @Metric({"NumLiveDataNodes", "Number of datanodes which are currently live"}) int getNumLiveDataNodes(); @Override // FSNamesystemMBean @Metric({"NumDeadDataNodes", "Number of datanodes which are currently dead"}) int getNumDeadDataNodes(); @Override // FSNamesystemMBean @Metric({"NumDecomLiveDataNodes", "Number of datanodes which have been decommissioned and are now live"}) int getNumDecomLiveDataNodes(); @Override // FSNamesystemMBean @Metric({"NumDecomDeadDataNodes", "Number of datanodes which have been decommissioned and are now dead"}) int getNumDecomDeadDataNodes(); @Override // FSNamesystemMBean @Metric({"VolumeFailuresTotal", "Total number of volume failures across all Datanodes"}) int getVolumeFailuresTotal(); @Override // FSNamesystemMBean @Metric({"EstimatedCapacityLostTotal", "An estimate of the total capacity lost due to volume failures"}) long getEstimatedCapacityLostTotal(); @Override // FSNamesystemMBean @Metric({"NumDecommissioningDataNodes", "Number of datanodes in decommissioning state"}) int getNumDecommissioningDataNodes(); @Override // FSNamesystemMBean @Metric({"StaleDataNodes", "Number of datanodes marked stale due to delayed heartbeat"}) int getNumStaleDataNodes(); @Override // FSNamesystemMBean @Metric({"NumStaleStorages", "Number of storages marked as content stale"}) int getNumStaleStorages(); @Override // FSNamesystemMBean String getTopUserOpCounts(); void logUpdateMasterKey(DelegationKey key); void logExpireDelegationToken(DelegationTokenIdentifier id); @Override // NameNodeMXBean String getVersion(); @Override // NameNodeMXBean long getUsed(); @Override // NameNodeMXBean long getFree(); @Override // NameNodeMXBean long getTotal(); @Override // NameNodeMXBean long getProvidedCapacity(); @Override // NameNodeMXBean String getSafemode(); @Override // NameNodeMXBean boolean isUpgradeFinalized(); @Override // NameNodeMXBean long getNonDfsUsedSpace(); @Override // NameNodeMXBean float getPercentUsed(); @Override // NameNodeMXBean long getBlockPoolUsedSpace(); @Override // NameNodeMXBean float getPercentBlockPoolUsed(); @Override // NameNodeMXBean float getPercentRemaining(); @Override // NameNodeMXBean long getCacheCapacity(); @Override // NameNodeMXBean long getCacheUsed(); @Override // NameNodeMXBean long getTotalBlocks(); @Override // NameNodeMXBean long getNumberOfMissingBlocks(); @Override // NameNodeMXBean long getNumberOfMissingBlocksWithReplicationFactorOne(); @Override // NameNodeMXBean int getThreads(); @Override // NameNodeMXBean String getLiveNodes(); @Override // NameNodeMXBean String getDeadNodes(); @Override // NameNodeMXBean String getDecomNodes(); @Override // NameNodeMXBean String getEnteringMaintenanceNodes(); @Override // NameNodeMXBean String getClusterId(); @Override // NameNodeMXBean String getBlockPoolId(); @Override // NameNodeMXBean String getNameDirStatuses(); @Override // NameNodeMXBean String getNodeUsage(); @Override // NameNodeMXBean String getNameJournalStatus(); @Override // NameNodeMxBean String getJournalTransactionInfo(); @Override // NameNodeMXBean long getNNStartedTimeInMillis(); @Override // NameNodeMXBean String getCompileInfo(); BlockManager getBlockManager(); @VisibleForTesting void setBlockManagerForTesting(BlockManager bm); @Override FSDirectory getFSDirectory(); @VisibleForTesting void setFSDirectory(FSDirectory dir); @Override CacheManager getCacheManager(); ErasureCodingPolicyManager getErasureCodingPolicyManager(); @Override HAContext getHAContext(); @Override // NameNodeMXBean String getCorruptFiles(); @Override // NameNodeMXBean int getCorruptFilesCount(); @Override // NameNodeMXBean long getNumberOfSnapshottableDirs(); @Override //NameNodeMXBean int getDistinctVersionCount(); @Override //NameNodeMXBean Map<String, Integer> getDistinctVersions(); @Override //NameNodeMXBean String getSoftwareVersion(); @Override // NameNodeStatusMXBean String getNameDirSize(); synchronized void verifyToken(DelegationTokenIdentifier identifier,
      byte[] password); @VisibleForTesting EditLogTailer getEditLogTailer(); @VisibleForTesting void setEditLogTailerForTests(EditLogTailer tailer); @VisibleForTesting ReentrantReadWriteLock getFsLockForTests(); @VisibleForTesting ReentrantLock getCpLockForTests(); @VisibleForTesting void setNNResourceChecker(NameNodeResourceChecker nnResourceChecker); SnapshotManager getSnapshotManager(); SnapshottableDirectoryStatus[] getSnapshottableDirListing(); SnapshotStatus[] getSnapshotListing(String snapshotRoot); void gcDeletedSnapshot(String snapshotRoot, String snapshotName); void setCreatedRollbackImages(boolean created); RollingUpgradeInfo getRollingUpgradeInfo(); boolean isNeedRollbackFsImage(); void setNeedRollbackFsImage(boolean needRollbackFsImage); @Override // NameNodeMXBean RollingUpgradeInfo.Bean getRollingUpgradeStatus(); boolean isRollingUpgrade(); int getEffectiveLayoutVersion(); ECTopologyVerifierResult getECTopologyResultForPolicies(
      String[] policyNames); @Override void removeXattr(long id, String xattrName); @Override @Metric({"TotalSyncCount", "Total number of sync operations performed on edit logs"}) long getTotalSyncCount(); @Override @Metric({"TotalSyncTimes", "Total time spend in sync operation on various edit logs"}) String getTotalSyncTimes(); long getBytesInFuture(); @Override // FSNamesystemMBean @Metric({"NumInMaintenanceLiveDataNodes", "Number of live Datanodes which are in maintenance state"}) int getNumInMaintenanceLiveDataNodes(); @Override // FSNamesystemMBean @Metric({"NumInMaintenanceDeadDataNodes", "Number of dead Datanodes which are in maintenance state"}) int getNumInMaintenanceDeadDataNodes(); @Override // FSNamesystemMBean @Metric({"NumEnteringMaintenanceDataNodes", "Number of Datanodes that are entering the maintenance state"}) int getNumEnteringMaintenanceDataNodes(); @Override // NameNodeMXBean String getVerifyECWithTopologyResult(); void checkErasureCodingSupported(String operationName); static final org.slf4j.Logger LOG; static final String DFS_NAMENODE_SNAPSHOT_TRASHROOT_ENABLED; static final boolean DFS_NAMENODE_SNAPSHOT_TRASHROOT_ENABLED_DEFAULT; static final Log auditLog; }
@Test public void testUniqueEditDirs() throws IOException { Configuration config = new Configuration(); config.set(DFS_NAMENODE_EDITS_DIR_KEY, "file: + "file: Collection<URI> editsDirs = FSNamesystem.getNamespaceEditsDirs(config); assertEquals(2, editsDirs.size()); }