congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.apache.hadoop.hdfs.server.protocol
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.hadoop.hdfs.server.protocol

Best Java code snippets using org.apache.hadoop.hdfs.server.protocol (Showing top 20 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

private static long getCapacity(DatanodeStorageReport report, StorageType t) {
 long capacity = 0L;
 for(StorageReport r : report.getStorageReports()) {
  if (r.getStorage().getStorageType() == t) {
   capacity += r.getCapacity();
  }
 }
 return capacity;
}
origin: org.apache.hadoop/hadoop-hdfs

private static long getMaxRemaining(DatanodeStorageReport report, StorageType t) {
 long max = 0L;
 for(StorageReport r : report.getStorageReports()) {
  if (r.getStorage().getStorageType() == t) {
   if (r.getRemaining() > max) {
    max = r.getRemaining();
   }
  }
 }
 return max;
}
origin: org.apache.hadoop/hadoop-hdfs

StorageReport toStorageReport() {
 return new StorageReport(
   new DatanodeStorage(storageID, state, storageType),
   false, capacity, dfsUsed, remaining, blockPoolUsed, nonDfsUsed);
}
origin: org.apache.hadoop/hadoop-hdfs

void updateState(StorageReport r) {
 capacity = r.getCapacity();
 dfsUsed = r.getDfsUsed();
 nonDfsUsed = r.getNonDfsUsed();
 remaining = r.getRemaining();
 blockPoolUsed = r.getBlockPoolUsed();
}
origin: org.apache.hadoop/hadoop-hdfs

BackupJournalManager(NamenodeRegistration bnReg,
  NamenodeRegistration nnReg) {
 journalInfo = new JournalInfo(nnReg.getLayoutVersion(),
   nnReg.getClusterID(), nnReg.getNamespaceID());
 this.bnReg = bnReg;
}
origin: org.apache.hadoop/hadoop-hdfs

public void updateFromStorage(DatanodeStorage storage) {
 state = storage.getState();
 storageType = storage.getStorageType();
}
origin: org.apache.hadoop/hadoop-hdfs

/** @return blocks with locations. */
public BlocksWithLocations getBlocks(DatanodeInfo datanode, long size, long
  minBlockSize)
  throws IOException {
 return namenode.getBlocks(datanode, size, minBlockSize);
}
origin: org.apache.hadoop/hadoop-hdfs

 @Override
 protected Void doWork() throws IOException {
  cachedActiveProxy.rollEditLog();
  return null;
 }
};
origin: org.apache.hadoop/hadoop-hdfs

 @Override
 public Long apply(RemoteEditLog log) {
  if (null == log) {
   return HdfsServerConstants.INVALID_TXID;
  }
  return log.getStartTxId();
 }
};
origin: org.apache.hadoop/hadoop-hdfs

@Override // NodeRegistration
public String getAddress() {
 return getXferAddr();
}
origin: org.apache.hadoop/hadoop-hdfs

@Override
public boolean equals(Object o) {
 if (!(o instanceof RemoteEditLog)) return false;
 return this.compareTo((RemoteEditLog)o) == 0;
}

origin: org.apache.hadoop/hadoop-hdfs

public RemoteEditLogManifest(List<RemoteEditLog> logs, long committedTxnId) {
 this.logs = logs;
 this.committedTxnId = committedTxnId;
 checkState();
}

origin: org.apache.hadoop/hadoop-hdfs

 public static BlockStatus fromCode(int code) {
  for (BlockStatus bs : BlockStatus.values()) {
   if (bs.code == code) {
    return bs;
   }
  }
  return null;
 }
}
origin: org.apache.hadoop/hadoop-hdfs

 void startLogSegment(long txId) throws IOException {
  backupNode.startLogSegment(journalInfo, 0, txId);
 }
}
origin: org.apache.hadoop/hadoop-hdfs

Capability(boolean isSupported) {
 supported = isSupported;
 int bits = ordinal() - 1;
 mask = (bits < 0) ? 0 : (1L << bits);
}
public long getMask() {
origin: org.apache.hadoop/hadoop-hdfs

 @Override
 Double getUtilization(DatanodeStorageReport r, final StorageType t) {
  long capacity = 0L;
  long dfsUsed = 0L;
  for(StorageReport s : r.getStorageReports()) {
   if (s.getStorage().getStorageType() == t) {
    capacity += s.getCapacity();
    dfsUsed += s.getDfsUsed();
   }
  }
  return capacity == 0L? null: dfsUsed*100.0/capacity;
 }
}
origin: org.apache.hadoop/hadoop-hdfs

private long getRemaining(DatanodeStorageReport report, StorageType t) {
 long remaining = 0L;
 for(StorageReport r : report.getStorageReports()) {
  if (r.getStorage().getStorageType() == t) {
   if (r.getRemaining() >= defaultBlockSize) {
    remaining += r.getRemaining();
   }
  }
 }
 return remaining;
}
origin: org.apache.hadoop/hadoop-hdfs

 @Override
 Double getUtilization(DatanodeStorageReport r, final StorageType t) {
  long capacity = 0L;
  long blockPoolUsed = 0L;
  for(StorageReport s : r.getStorageReports()) {
   if (s.getStorage().getStorageType() == t) {
    capacity += s.getCapacity();
    blockPoolUsed += s.getBlockPoolUsed();
   }
  }
  return capacity == 0L? null: blockPoolUsed*100.0/capacity;
 }
}
origin: org.apache.hadoop/hadoop-hdfs

@Override
void accumulateSpaces(DatanodeStorageReport r) {
 for(StorageReport s : r.getStorageReports()) {
  final StorageType t = s.getStorage().getStorageType();
  totalCapacities.add(t, s.getCapacity());
  totalUsedSpaces.add(t, s.getDfsUsed());
 }
}

origin: org.apache.hadoop/hadoop-hdfs

@Override
void accumulateSpaces(DatanodeStorageReport r) {
 for(StorageReport s : r.getStorageReports()) {
  final StorageType t = s.getStorage().getStorageType();
  totalCapacities.add(t, s.getCapacity());
  totalUsedSpaces.add(t, s.getBlockPoolUsed());
 }
}
org.apache.hadoop.hdfs.server.protocol

Most used classes

  • NamespaceInfo
    NamespaceInfo is returned by the name-node in reply to a data-node handshake.
  • BlockCommand
    A BlockCommand is an instruction to a datanode regarding some blocks under its control. It tells the
  • DatanodeCommand
    Base class for data-node command. Issued by the name-node to notify data-nodes what should be done.
  • DatanodeProtocol
    Protocol that a DFS datanode uses to communicate with the NameNode. It's used to upload current load
  • DatanodeRegistration
    DatanodeRegistration class contains all information the name-node needs to identify and verify a dat
  • BlocksWithLocations$BlockWithLocations,
  • BlocksWithLocations,
  • NamenodeProtocol,
  • BlockRecoveryCommand$RecoveringBlock,
  • DatanodeStorage,
  • DatanodeStorageReport,
  • ReplicaRecoveryInfo,
  • StorageReport,
  • DisallowedDatanodeException,
  • NamenodeRegistration,
  • ReceivedDeletedBlockInfo,
  • VolumeFailureSummary,
  • BalancerBandwidthCommand,
  • BlockIdCommand
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now