public ReplicationWorker(ServerContext context, VolumeManager fs) { this.context = context; this.fs = fs; this.conf = context.getConfiguration(); }
public AccumuloConfiguration getConfiguration() { return context.getConfiguration(); }
public AccumuloConfiguration getConfiguration() { return context.getConfiguration(); }
AccumuloConfiguration getConfiguration() { return context.getConfiguration(); }
/** * Retrieve the SSL/TLS configuration for starting up a listening service */ public SslConnectionParams getServerSslParams() { return SslConnectionParams.forServer(getConfiguration()); }
@Override public ReplicationProcessor newProcessor() { return new ReplicationProcessor(context, context.getConfiguration(), fs); }
/** * Should only be called by the Tablet server */ public synchronized void setupCrypto() throws CryptoService.CryptoException { if (cryptoService != null) throw new CryptoService.CryptoException("Crypto Service " + cryptoService.getClass().getName() + " already exists and cannot be setup again"); AccumuloConfiguration acuConf = getConfiguration(); cryptoService = CryptoServiceFactory.newInstance(acuConf, ClassloaderType.ACCUMULO); }
public int getMaxReplicationThreads(MasterMonitorInfo mmi) { int activeTservers = mmi.getTServerInfoSize(); // The number of threads each tserver will use at most to replicate data int replicationThreadsPerServer = Integer .parseInt(context.getConfiguration().get(Property.REPLICATION_WORKER_THREADS)); // The total number of "slots" we have to replicate data return activeTservers * replicationThreadsPerServer; }
public static String switchRootTableVolume(ServerContext context, String location) throws IOException { String newLocation = switchVolume(location, FileType.TABLE, ServerConstants.getVolumeReplacements(context.getConfiguration(), context.getHadoopConf())); if (newLocation != null) { MetadataTableUtil.setRootTabletDir(context, newLocation); log.info("Volume replaced: {} -> {}", location, newLocation); return new Path(newLocation).toString(); } return location; }
public static String[] getBaseUris(ServerContext context) { return getBaseUris(context.getConfiguration(), context.getHadoopConf()); }
public EmbeddedWebServer(String host, int port) { server = new Server(); final AccumuloConfiguration conf = Monitor.getContext().getConfiguration(); connector = new ServerConnector(server, getConnectionFactories(conf)); connector.setHost(host); connector.setPort(port); handler = new ServletContextHandler( ServletContextHandler.SESSIONS | ServletContextHandler.SECURITY); handler.getSessionHandler().getSessionCookieConfig().setHttpOnly(true); handler.setContextPath("/"); }
protected static PermissionHandler getPermHandler(ServerContext context, boolean initialize) { PermissionHandler toRet = Property.createInstanceFromPropertyName(context.getConfiguration(), Property.INSTANCE_SECURITY_PERMISSION_HANDLER, PermissionHandler.class, ZKPermHandler.getInstance()); toRet.initialize(context, initialize); return toRet; }
protected static Authorizor getAuthorizor(ServerContext context, boolean initialize) { Authorizor toRet = Property.createInstanceFromPropertyName(context.getConfiguration(), Property.INSTANCE_SECURITY_AUTHORIZOR, Authorizor.class, ZKAuthorizor.getInstance()); toRet.initialize(context, initialize); return toRet; }
protected static Authenticator getAuthenticator(ServerContext context, boolean initialize) { Authenticator toRet = Property.createInstanceFromPropertyName(context.getConfiguration(), Property.INSTANCE_SECURITY_AUTHENTICATOR, Authenticator.class, ZKAuthenticator.getInstance()); toRet.initialize(context, initialize); return toRet; }
public synchronized void startListeningForTabletServerChanges() { scanServers(); SimpleTimer.getInstance(context.getConfiguration()).schedule(new Runnable() { @Override public void run() { scanServers(); } }, 0, 5000); }
public static Map<KeyExtent,Long> estimateSizes(ServerContext context, Path mapFile, long fileSize, List<KeyExtent> extents) throws IOException { FileSystem ns = context.getVolumeManager().getVolumeByPath(mapFile).getFileSystem(); return BulkImport.estimateSizes(context.getConfiguration(), mapFile, fileSize, extents, ns, null, context.getCryptoService()); }
private Scanner getScanner(AccumuloClient client) throws AccumuloException { try { AccumuloConfiguration conf = Monitor.getContext().getConfiguration(); final String table = conf.get(Property.TRACE_TABLE); if (!client.tableOperations().exists(table)) { return null; } return client.createScanner(table); } catch (AccumuloSecurityException | TableNotFoundException ex) { return null; } }
@Override public void initialize(ServerContext context, boolean initialize) { this.context = context; zooCache = new ZooCache(context.getZooReaderWriter(), null); impersonation = new UserImpersonation(context.getConfiguration()); zkAuthenticator.initialize(context, initialize); zkUserPath = Constants.ZROOT + "/" + context.getInstanceID() + "/users"; }
public static void main(String[] args) throws Exception { final String app = "tracer"; ServerOpts opts = new ServerOpts(); opts.parseArgs(app, args); ServerContext context = new ServerContext(opts.getSiteConfiguration()); loginTracer(context.getConfiguration()); MetricsSystemHelper.configure(TraceServer.class.getSimpleName()); ServerUtil.init(context, app); try (TraceServer server = new TraceServer(context, opts.getAddress())) { server.run(); } finally { log.info("tracer stopping"); context.getZooReaderWriter().getZooKeeper().close(); } }
private synchronized FileSKVIterator getReader() throws IOException { if (reader == null) { Configuration conf = context.getHadoopConf(); FileSystem fs = FileSystem.getLocal(conf); reader = new RFileOperations().newReaderBuilder() .forFile(memDumpFile, fs, conf, context.getCryptoService()) .withTableConfiguration(context.getConfiguration()).seekToBeginning().build(); if (iflag != null) reader.setInterruptFlag(iflag); if (getSamplerConfig() != null) { reader = reader.getSample(getSamplerConfig()); } } return reader; }