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

How to use
DelegationTokenConfig
in
org.apache.accumulo.core.client.admin

Best Java code snippets using org.apache.accumulo.core.client.admin.DelegationTokenConfig (Showing top 20 results out of 315)

origin: apache/accumulo

try {
 ClientContext client = OutputConfigurator.client(CLASS, job.getConfiguration());
 token = client.securityOperations().getDelegationToken(new DelegationTokenConfig());
} catch (Exception e) {
 log.warn("Failed to automatically obtain DelegationToken, "
origin: apache/accumulo

/**
 * Serialize the delegation token config into the thrift variant
 *
 * @param config
 *          The configuration
 */
public static TDelegationTokenConfig serialize(DelegationTokenConfig config) {
 TDelegationTokenConfig tconfig = new TDelegationTokenConfig();
 tconfig.setLifetime(config.getTokenLifetime(TimeUnit.MILLISECONDS));
 return tconfig;
}
origin: apache/accumulo

 /**
  * Deserialize the Thrift delegation token config into the non-thrift variant
  *
  * @param tconfig
  *          The thrift configuration
  */
 public static DelegationTokenConfig deserialize(TDelegationTokenConfig tconfig) {
  DelegationTokenConfig config = new DelegationTokenConfig();
  if (tconfig.isSetLifetime()) {
   config.setTokenLifetime(tconfig.getLifetime(), TimeUnit.MILLISECONDS);
  }
  return config;
 }
}
origin: apache/accumulo

try {
 ClientContext client = InputConfigurator.client(CLASS, job.getConfiguration());
 token = client.securityOperations().getDelegationToken(new DelegationTokenConfig());
} catch (Exception e) {
 log.warn("Failed to automatically obtain DelegationToken, "
origin: org.apache.accumulo/accumulo-core

 /**
  * Deserialize the Thrift delegation token config into the non-thrift variant
  *
  * @param tconfig
  *          The thrift configuration
  */
 public static DelegationTokenConfig deserialize(TDelegationTokenConfig tconfig) {
  DelegationTokenConfig config = new DelegationTokenConfig();
  if (tconfig.isSetLifetime()) {
   config.setTokenLifetime(tconfig.getLifetime(), TimeUnit.MILLISECONDS);
  }
  return config;
 }
}
origin: apache/accumulo

long requestedLifetime = cfg.getTokenLifetime(TimeUnit.MILLISECONDS);
if (requestedLifetime > 0) {
 long requestedExpirationDate = identifier.getIssueDate() + requestedLifetime;
origin: apache/accumulo

try {
 ClientContext client = OutputConfigurator.client(CLASS, job);
 token = client.securityOperations().getDelegationToken(new DelegationTokenConfig());
} catch (Exception e) {
 log.warn("Failed to automatically obtain DelegationToken, "
origin: org.apache.accumulo/accumulo-test

 @Override
 public AuthenticationToken run() throws Exception {
  Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
  log.info("Created connector as {}", rootUser.getPrincipal());
  assertEquals(rootUser.getPrincipal(), conn.whoami());
  // Should fail
  return conn.securityOperations().getDelegationToken(
    new DelegationTokenConfig().setTokenLifetime(Long.MAX_VALUE, TimeUnit.MILLISECONDS));
 }
});
origin: org.apache.accumulo/accumulo-core

/**
 * Serialize the delegation token config into the thrift variant
 *
 * @param config
 *          The configuration
 */
public static TDelegationTokenConfig serialize(DelegationTokenConfig config) {
 TDelegationTokenConfig tconfig = new TDelegationTokenConfig();
 tconfig.setLifetime(config.getTokenLifetime(TimeUnit.MILLISECONDS));
 return tconfig;
}
origin: apache/accumulo

try {
 ClientContext client = InputConfigurator.client(CLASS, job);
 token = client.securityOperations().getDelegationToken(new DelegationTokenConfig());
} catch (Exception e) {
 log.warn("Failed to automatically obtain DelegationToken, Mappers/Reducers will likely"
origin: org.apache.accumulo/accumulo-test

 @Override
 public AuthenticationToken run() throws Exception {
  Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
  log.info("Created connector as {}", rootUser.getPrincipal());
  assertEquals(rootUser.getPrincipal(), conn.whoami());
  return conn.securityOperations()
    .getDelegationToken(new DelegationTokenConfig().setTokenLifetime(5, TimeUnit.MINUTES));
 }
});
origin: org.apache.accumulo/accumulo-server-base

long requestedLifetime = cfg.getTokenLifetime(TimeUnit.MILLISECONDS);
if (0 < requestedLifetime) {
 long requestedExpirationDate = identifier.getIssueDate() + requestedLifetime;
origin: org.apache.hive/hive-accumulo-handler

/**
 * Obtain a DelegationToken from Accumulo.
 *
 * @param conn
 *          The Accumulo connector
 * @return The DelegationToken instance
 * @throws IOException
 *           If the token cannot be obtained
 */
public AuthenticationToken getDelegationToken(Connector conn) throws IOException {
 try {
  DelegationTokenConfig config = new DelegationTokenConfig();
  return conn.securityOperations().getDelegationToken(config);
 } catch (AccumuloException | AccumuloSecurityException e) {
  throw new IOException("Failed to obtain DelegationToken", e);
 }
}
origin: org.apache.accumulo/accumulo-test

 @Override
 public Void run() throws Exception {
  // As the "root" user, open up the connection and get a delegation token
  Connector conn = mac.getConnector(qualifiedNewUser, new KerberosToken());
  log.info("Created connector as {}", qualifiedNewUser);
  assertEquals(qualifiedNewUser, conn.whoami());
  conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
  return null;
 }
});
origin: org.apache.accumulo/accumulo-core

 return conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
} catch (Exception e) {
 final String msg = "Failed to acquire DelegationToken for use with MapReduce";
origin: org.apache.accumulo/accumulo-client-mapreduce

 return client.securityOperations().getDelegationToken(new DelegationTokenConfig());
} catch (Exception e) {
 final String msg = "Failed to acquire DelegationToken for use with MapReduce";
origin: org.apache.accumulo/accumulo-hadoop-mapreduce

return client.securityOperations().getDelegationToken(new DelegationTokenConfig());
origin: org.apache.accumulo/accumulo-test

 @Override
 public AuthenticationToken run() throws Exception {
  // As the "root" user, open up the connection and get a delegation token
  Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
  log.info("Created connector as {}", rootUser.getPrincipal());
  assertEquals(rootUser.getPrincipal(), conn.whoami());
  return conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
 }
});
origin: org.apache.accumulo/accumulo-test

token = conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
origin: org.apache.accumulo/accumulo-test

.getDelegationToken(new DelegationTokenConfig());
org.apache.accumulo.core.client.adminDelegationTokenConfig

Javadoc

Configuration options for obtaining a delegation token created by SecurityOperations#getDelegationToken(DelegationTokenConfig)

Most used methods

  • <init>
  • getTokenLifetime
    The current token lifetime. A value of zero corresponds to using the system configured lifetime.
  • setTokenLifetime
    Requests a specific lifetime for the token that is different than the default system lifetime. The l

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Top PhpStorm plugins
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