@Override public void connectFromWorker(TachyonConf conf, String host) throws IOException { if (!conf.containsKey(Constants.WORKER_KEYTAB_KEY) || !conf.containsKey(Constants.WORKER_PRINCIPAL_KEY)) { return; } String workerKeytab = conf.get(Constants.WORKER_KEYTAB_KEY); String workerPrincipal = conf.get(Constants.WORKER_PRINCIPAL_KEY); login(Constants.WORKER_KEYTAB_KEY, workerKeytab, Constants.WORKER_PRINCIPAL_KEY, workerPrincipal, host); }
@Override public void connectFromMaster(TachyonConf conf, String host) throws IOException { if (!conf.containsKey(Constants.MASTER_KEYTAB_KEY) || !conf.containsKey(Constants.MASTER_PRINCIPAL_KEY)) { return; } String masterKeytab = conf.get(Constants.MASTER_KEYTAB_KEY); String masterPrincipal = conf.get(Constants.MASTER_PRINCIPAL_KEY); login(Constants.MASTER_KEYTAB_KEY, masterKeytab, Constants.MASTER_PRINCIPAL_KEY, masterPrincipal, host); }
/** * Creates a <code>MetricsSystem</code> using the default metrics config. * * @param instance the instance name * @param tachyonConf the {@link TachyonConf} instance for configuration properties. */ public MetricsSystem(String instance, TachyonConf tachyonConf) { mInstance = instance; mTachyonConf = tachyonConf; String metricsConfFile = null; if (mTachyonConf.containsKey(Constants.METRICS_CONF_FILE)) { metricsConfFile = mTachyonConf.get(Constants.METRICS_CONF_FILE); } mMetricsConfig = new MetricsConfig(metricsConfFile); }
if (mTachyonConf.containsKey(Constants.WORKER_NETWORK_NETTY_BACKLOG)) { boot.option(ChannelOption.SO_BACKLOG, mTachyonConf.getInt(Constants.WORKER_NETWORK_NETTY_BACKLOG)); if (mTachyonConf.containsKey(Constants.WORKER_NETWORK_NETTY_BUFFER_SEND)) { boot.option(ChannelOption.SO_SNDBUF, (int) mTachyonConf.getBytes(Constants.WORKER_NETWORK_NETTY_BUFFER_SEND)); if (mTachyonConf.containsKey(Constants.WORKER_NETWORK_NETTY_BUFFER_RECEIVE)) { boot.option(ChannelOption.SO_RCVBUF, (int) mTachyonConf.getBytes(Constants.WORKER_NETWORK_NETTY_BUFFER_RECEIVE));
public S3UnderFileSystem(String bucketName, TachyonConf tachyonConf) throws ServiceException { super(tachyonConf); Preconditions.checkArgument(tachyonConf.containsKey(Constants.S3_ACCESS_KEY), "Property " + Constants.S3_ACCESS_KEY + " is required to connect to S3"); Preconditions.checkArgument(tachyonConf.containsKey(Constants.S3_SECRET_KEY), "Property " + Constants.S3_SECRET_KEY + " is required to connect to S3"); AWSCredentials awsCredentials = new AWSCredentials(tachyonConf.get(Constants.S3_ACCESS_KEY), tachyonConf.get( Constants.S3_SECRET_KEY)); mBucketName = bucketName; Jets3tProperties props = new Jets3tProperties(); if (tachyonConf.containsKey(Constants.UNDERFS_S3_PROXY_HOST)) { props.setProperty("httpclient.proxy-autodetect", "false"); props.setProperty("httpclient.proxy-host", tachyonConf.get(Constants.UNDERFS_S3_PROXY_HOST)); props.setProperty("httpclient.proxy-port", tachyonConf.get(Constants.UNDERFS_S3_PROXY_PORT)); } if (tachyonConf.containsKey(Constants.UNDERFS_S3_PROXY_HTTPS_ONLY)) { props.setProperty("s3service.https-only", Boolean.toString(tachyonConf.getBoolean(Constants.UNDERFS_S3_PROXY_HTTPS_ONLY))); } LOG.debug("Initializing S3 underFs with properties: " + props.getProperties()); mClient = new RestS3Service(awsCredentials, null, null, props); mBucketPrefix = Constants.HEADER_S3N + mBucketName + PATH_SEPARATOR; }