private void init(double threshold) throws IOException {
this.threshold = threshold;
this.namenode = createNamenode(conf);
this.client = DFSClient.createNamenode(conf);
this.fs = FileSystem.get(conf);
ExportedAccessKeys keys = namenode.getAccessKeys();
this.isAccessTokenEnabled = keys.isAccessTokenEnabled();
if (isAccessTokenEnabled) {
long accessKeyUpdateInterval = keys.getKeyUpdateInterval();
long accessTokenLifetime = keys.getTokenLifetime();
LOG.info("Access token params received from NN: keyUpdateInterval="
+ accessKeyUpdateInterval / (60 * 1000) + " min(s), tokenLifetime="
+ accessTokenLifetime / (60 * 1000) + " min(s)");
this.accessTokenHandler = new AccessTokenHandler(false,
accessKeyUpdateInterval, accessTokenLifetime);