@Override
  protected void logUpdateMasterKey(DelegationKey key) throws IOException {
    int keySeq = this.tokenStore.addMasterKey(encodeWritable(key));
    // update key with assigned identifier
    DelegationKey keyWithSeq = new DelegationKey(keySeq, key.getExpiryDate(), key.getKey());
    String keyStr = encodeWritable(keyWithSeq);
    this.tokenStore.updateMasterKey(keySeq, keyStr);
    decodeWritable(key, keyStr);
    setCurrentKeyId(key.getKeyId());
    LOGGER.info("New master key with key id={}", key.getKeyId());
    super.logUpdateMasterKey(key);
  }
Synchronize master key updates / sequence generation for multiple nodes.
NOTE: {@link AbstractDelegationTokenSecretManager} keeps currentKey private, so we need
to utilize this "hook" to manipulate the key through the object reference.
This .20S workaround should cease to exist when Hadoop supports token store.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/security/TokenStoreDelegationTokenSecretManager.java