Package org.apache.hadoop.hive.thrift.TokenStoreDelegationTokenSecretManager

Examples of org.apache.hadoop.hive.thrift.TokenStoreDelegationTokenSecretManager.TokenStoreError


          if (zkSession == null || zkSession.getState() == States.CLOSED) {
            try {
            zkSession = new ZooKeeper(this.zkConnectString, this.zkSessionTimeout,
                new ZooKeeperWatcher());
            } catch (IOException ex) {
              throw new TokenStoreError("Token store error.", ex);
            }
          }
        }
    }
    return zkSession;
View Full Code Here


    ZooKeeper zk = getSession();
    try {
        ensurePath(zk, rootNode + NODE_KEYS);
        ensurePath(zk, rootNode + NODE_TOKENS);
      } catch (Exception e) {
        throw new TokenStoreError("Failed to validate token path.", e);
      }
  }
View Full Code Here

      String newNode = zk.create(rootNode + NODE_KEYS + "/", s.getBytes(), Ids.OPEN_ACL_UNSAFE,
          CreateMode.PERSISTENT_SEQUENTIAL);
      LOGGER.info("Added key {}", newNode);
      return getSeq(newNode);
    } catch (KeeperException ex) {
      throw new TokenStoreError(ex);
    } catch (InterruptedException ex) {
      throw new TokenStoreError(ex);
    }
  }
View Full Code Here

    try {
      ZooKeeper zk = getSession();
      zk.setData(rootNode + NODE_KEYS + "/" + String.format(ZK_SEQ_FORMAT, keySeq), s.getBytes(),
          -1);
    } catch (KeeperException ex) {
      throw new TokenStoreError(ex);
    } catch (InterruptedException ex) {
      throw new TokenStoreError(ex);
    }
  }
View Full Code Here

      zk.delete(rootNode + NODE_KEYS + "/" + String.format(ZK_SEQ_FORMAT, keySeq), -1);
      return true;
    } catch (KeeperException.NoNodeException ex) {
      return false;
    } catch (KeeperException ex) {
      throw new TokenStoreError(ex);
    } catch (InterruptedException ex) {
      throw new TokenStoreError(ex);
    }
  }
View Full Code Here

      for (byte[] keyBytes : allKeys.values()) {
          result[resultIdx++] = new String(keyBytes);
      }
      return result;
    } catch (KeeperException ex) {
      throw new TokenStoreError(ex);
    } catch (InterruptedException ex) {
      throw new TokenStoreError(ex);
    }
  }
View Full Code Here

  private String getTokenPath(DelegationTokenIdentifier tokenIdentifier) {
    try {
      return rootNode + NODE_TOKENS + "/"
          + TokenStoreDelegationTokenSecretManager.encodeWritable(tokenIdentifier);
    } catch (IOException ex) {
      throw new TokenStoreError("Failed to encode token identifier", ex);
    }
  }
View Full Code Here

      LOGGER.info("Added token: {}", newNode);
      return true;
    } catch (KeeperException.NodeExistsException ex) {
      return false;
    } catch (KeeperException ex) {
      throw new TokenStoreError(ex);
    } catch (InterruptedException ex) {
      throw new TokenStoreError(ex);
    }
  }
View Full Code Here

      zk.delete(getTokenPath(tokenIdentifier), -1);
      return true;
    } catch (KeeperException.NoNodeException ex) {
      return false;
    } catch (KeeperException ex) {
      throw new TokenStoreError(ex);
    } catch (InterruptedException ex) {
      throw new TokenStoreError(ex);
    }
  }
View Full Code Here

      ZooKeeper zk = getSession();
      byte[] tokenBytes = zk.getData(getTokenPath(tokenIdentifier), false, null);
      try {
        return HiveDelegationTokenSupport.decodeDelegationTokenInformation(tokenBytes);
      } catch (Exception ex) {
        throw new TokenStoreError("Failed to decode token", ex);
      }
    } catch (KeeperException.NoNodeException ex) {
      return null;
    } catch (KeeperException ex) {
      throw new TokenStoreError(ex);
    } catch (InterruptedException ex) {
      throw new TokenStoreError(ex);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.thrift.TokenStoreDelegationTokenSecretManager.TokenStoreError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.