congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
NamenodeProtocol.getBlockKeys
Code IndexAdd Tabnine to your IDE (free)

How to use
getBlockKeys
method
in
org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol

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

origin: org.apache.hadoop/hadoop-hdfs

@Override
public void run() {
 try {
  while (shouldRun) {
   try {
    blockTokenSecretManager.addKeys(namenode.getBlockKeys());
   } catch (IOException e) {
    LOG.error("Failed to set keys", e);
   }
   Thread.sleep(sleepInterval);
  }
 } catch (InterruptedException e) {
  LOG.debug("InterruptedException in block key updater thread", e);
 } catch (Throwable e) {
  LOG.error("Exception in block key updater thread", e);
  shouldRun = false;
 }
}
origin: org.apache.hadoop/hadoop-hdfs

@Override
public GetBlockKeysResponseProto getBlockKeys(RpcController unused,
  GetBlockKeysRequestProto request) throws ServiceException {
 ExportedBlockKeys keys;
 try {
  keys = impl.getBlockKeys();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
 GetBlockKeysResponseProto.Builder builder = 
   GetBlockKeysResponseProto.newBuilder();
 if (keys != null) {
  builder.setKeys(PBHelper.convert(keys));
 }
 return builder.build();
}
origin: org.apache.hadoop/hadoop-hdfs

this.timer = new Timer();
final ExportedBlockKeys keys = namenode.getBlockKeys();
this.isBlockTokenEnabled = keys.isBlockTokenEnabled();
if (isBlockTokenEnabled) {
origin: ch.cern.hadoop/hadoop-hdfs

@Override
public void run() {
 try {
  while (shouldRun) {
   try {
    blockTokenSecretManager.addKeys(namenode.getBlockKeys());
   } catch (IOException e) {
    LOG.error("Failed to set keys", e);
   }
   Thread.sleep(sleepInterval);
  }
 } catch (InterruptedException e) {
  LOG.debug("InterruptedException in block key updater thread", e);
 } catch (Throwable e) {
  LOG.error("Exception in block key updater thread", e);
  shouldRun = false;
 }
}
origin: io.prestosql.hadoop/hadoop-apache

@Override
public void run() {
 try {
  while (shouldRun) {
   try {
    blockTokenSecretManager.addKeys(namenode.getBlockKeys());
   } catch (IOException e) {
    LOG.error("Failed to set keys", e);
   }
   Thread.sleep(sleepInterval);
  }
 } catch (InterruptedException e) {
  LOG.debug("InterruptedException in block key updater thread", e);
 } catch (Throwable e) {
  LOG.error("Exception in block key updater thread", e);
  shouldRun = false;
 }
}
origin: io.prestosql.hadoop/hadoop-apache

@Override
public GetBlockKeysResponseProto getBlockKeys(RpcController unused,
  GetBlockKeysRequestProto request) throws ServiceException {
 ExportedBlockKeys keys;
 try {
  keys = impl.getBlockKeys();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
 GetBlockKeysResponseProto.Builder builder = 
   GetBlockKeysResponseProto.newBuilder();
 if (keys != null) {
  builder.setKeys(PBHelper.convert(keys));
 }
 return builder.build();
}
origin: ch.cern.hadoop/hadoop-hdfs

@Override
public GetBlockKeysResponseProto getBlockKeys(RpcController unused,
  GetBlockKeysRequestProto request) throws ServiceException {
 ExportedBlockKeys keys;
 try {
  keys = impl.getBlockKeys();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
 GetBlockKeysResponseProto.Builder builder = 
   GetBlockKeysResponseProto.newBuilder();
 if (keys != null) {
  builder.setKeys(PBHelper.convert(keys));
 }
 return builder.build();
}
origin: ch.cern.hadoop/hadoop-hdfs

public KeyManager(String blockpoolID, NamenodeProtocol namenode,
  boolean encryptDataTransfer, Configuration conf) throws IOException {
 this.namenode = namenode;
 this.encryptDataTransfer = encryptDataTransfer;
 this.timer = new Timer();
 final ExportedBlockKeys keys = namenode.getBlockKeys();
 this.isBlockTokenEnabled = keys.isBlockTokenEnabled();
 if (isBlockTokenEnabled) {
  long updateInterval = keys.getKeyUpdateInterval();
  long tokenLifetime = keys.getTokenLifetime();
  LOG.info("Block token params received from NN: update interval="
    + StringUtils.formatTime(updateInterval)
    + ", token lifetime=" + StringUtils.formatTime(tokenLifetime));
  String encryptionAlgorithm = conf.get(
    DFSConfigKeys.DFS_DATA_ENCRYPTION_ALGORITHM_KEY);
  this.blockTokenSecretManager = new BlockTokenSecretManager(
    updateInterval, tokenLifetime, blockpoolID, encryptionAlgorithm);
  this.blockTokenSecretManager.addKeys(keys);
  // sync block keys with NN more frequently than NN updates its block keys
  this.blockKeyUpdater = new BlockKeyUpdater(updateInterval / 4);
  this.shouldRun = true;
 } else {
  this.blockTokenSecretManager = null;
  this.blockKeyUpdater = null;
 }
}

origin: io.prestosql.hadoop/hadoop-apache

public KeyManager(String blockpoolID, NamenodeProtocol namenode,
  boolean encryptDataTransfer, Configuration conf) throws IOException {
 this.namenode = namenode;
 this.encryptDataTransfer = encryptDataTransfer;
 this.timer = new Timer();
 final ExportedBlockKeys keys = namenode.getBlockKeys();
 this.isBlockTokenEnabled = keys.isBlockTokenEnabled();
 if (isBlockTokenEnabled) {
  long updateInterval = keys.getKeyUpdateInterval();
  long tokenLifetime = keys.getTokenLifetime();
  LOG.info("Block token params received from NN: update interval="
    + StringUtils.formatTime(updateInterval)
    + ", token lifetime=" + StringUtils.formatTime(tokenLifetime));
  String encryptionAlgorithm = conf.get(
    DFSConfigKeys.DFS_DATA_ENCRYPTION_ALGORITHM_KEY);
  this.blockTokenSecretManager = new BlockTokenSecretManager(
    updateInterval, tokenLifetime, blockpoolID, encryptionAlgorithm);
  this.blockTokenSecretManager.addKeys(keys);
  // sync block keys with NN more frequently than NN updates its block keys
  this.blockKeyUpdater = new BlockKeyUpdater(updateInterval / 4);
  this.shouldRun = true;
 } else {
  this.blockTokenSecretManager = null;
  this.blockKeyUpdater = null;
 }
}

origin: ch.cern.hadoop/hadoop-hdfs

when(namenode.getBlockKeys()).thenReturn(btsm.exportKeys());
org.apache.hadoop.hdfs.server.protocolNamenodeProtocolgetBlockKeys

Javadoc

Get the current block keys

Popular methods of NamenodeProtocol

  • getBlocks
    Get a list of blocks belonging to datanode whose total size equals size.
  • rollEditLog
    Closes the current edit log and opens a new one. The call fails if the file system is in SafeMode.
  • getEditLogManifest
    Return a structure containing details about all edit logs available to be fetched from the NameNode.
  • versionRequest
    Request name-node version and storage information.
  • endCheckpoint
    A request to the active name-node to finalize previously started checkpoint.
  • errorReport
    Report to the active name-node an error occurred on a subordinate node. Depending on the error code
  • getMostRecentCheckpointTxId
    Get the transaction ID of the most recent checkpoint.
  • getTransactionID
  • isUpgradeFinalized
  • registerSubordinateNamenode
    Register a subordinate name-node like backup node.
  • startCheckpoint
    A request to the active name-node to start a checkpoint. The name-node should decide whether to admi
  • getEditLogSize
    Get the size of the current edit log (in bytes).
  • startCheckpoint,
  • getEditLogSize,
  • rollFsImage,
  • getNextSPSPath,
  • isRollingUpgrade

Popular in Java

  • Parsing JSON documents to java classes using gson
  • findViewById (Activity)
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top 12 Jupyter Notebook extensions
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