private void updatePlugins(String property) { if (property.equals(Property.MASTER_TABLET_BALANCER.getKey())) { AccumuloConfiguration conf = master.getConfiguration(); TabletBalancer balancer = Property.createInstanceFromPropertyName(conf, Property.MASTER_TABLET_BALANCER, TabletBalancer.class, new DefaultLoadBalancer()); balancer.init(master.getContext()); master.tabletBalancer = balancer; log.info("tablet balancer changed to {}", master.tabletBalancer.getClass().getName()); } }
public static CryptoService newInstance(AccumuloConfiguration conf, ClassloaderType ct) { CryptoService newCryptoService; if (ct == ClassloaderType.ACCUMULO) { newCryptoService = Property.createInstanceFromPropertyName(conf, Property.INSTANCE_CRYPTO_SERVICE, CryptoService.class, new NoCryptoService()); } else if (ct == ClassloaderType.JAVA) { String clazzName = conf.get(Property.INSTANCE_CRYPTO_SERVICE); if (clazzName == null || clazzName.trim().isEmpty()) { newCryptoService = new NoCryptoService(); } else { try { newCryptoService = CryptoServiceFactory.class.getClassLoader().loadClass(clazzName) .asSubclass(CryptoService.class).newInstance(); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new RuntimeException(e); } } } else { throw new IllegalArgumentException(); } newCryptoService.init(conf.getAllPropertiesWithPrefix(Property.INSTANCE_CRYPTO_PREFIX)); return newCryptoService; }
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; }
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 VolumeManagerImpl(Map<String,Volume> volumes, Volume defaultVolume, AccumuloConfiguration conf, Configuration hadoopConf) { this.volumesByName = volumes; this.defaultVolume = defaultVolume; // We may have multiple directories used in a single FileSystem (e.g. testing) this.volumesByFileSystemUri = HashMultimap.create(); invertVolumesByFileSystem(volumesByName, volumesByFileSystemUri); ensureSyncIsEnabled(); // if they supplied a property and we cannot load it, then fail hard VolumeChooser chooser1; try { chooser1 = Property.createInstanceFromPropertyName(conf, Property.GENERAL_VOLUME_CHOOSER, VolumeChooser.class, null); } catch (NullPointerException npe) { chooser1 = null; // null chooser handled below } if (chooser1 == null) { throw new VolumeChooserException( "Failed to load volume chooser specified by " + Property.GENERAL_VOLUME_CHOOSER); } chooser = chooser1; this.hadoopConf = hadoopConf; }
if (!closeTasksQueued.contains(sortId) && !sortsQueued.contains(sortId)) { AccumuloConfiguration aconf = master.getConfiguration(); LogCloser closer = Property.createInstanceFromPropertyName(aconf, Property.MASTER_WALOG_CLOSER_IMPLEMETATION, LogCloser.class, new HadoopLogCloser()); Long delay = recoveryDelay.get(sortId);
AuthenticationToken token = Property.createInstanceFromPropertyName(conf, Property.TRACE_TOKEN_TYPE, AuthenticationToken.class, new PasswordToken()); token.init(props);
.setIdleTime(aconf.getTimeInMillis(Property.GENERAL_RPC_TIMEOUT)); tserverSet = new LiveTServerSet(context, this); this.tabletBalancer = Property.createInstanceFromPropertyName(aconf, Property.MASTER_TABLET_BALANCER, TabletBalancer.class, new DefaultLoadBalancer()); this.tabletBalancer.init(context);
protected VolumeManagerImpl(Map<String,Volume> volumes, Volume defaultVolume, AccumuloConfiguration conf) { this.volumesByName = volumes; this.defaultVolume = defaultVolume; // We may have multiple directories used in a single FileSystem (e.g. testing) this.volumesByFileSystemUri = HashMultimap.create(); invertVolumesByFileSystem(volumesByName, volumesByFileSystemUri); ensureSyncIsEnabled(); // Keep in sync with default type in the property definition. chooser = Property.createInstanceFromPropertyName(conf, Property.GENERAL_VOLUME_CHOOSER, VolumeChooser.class, new PerTableVolumeChooser()); }
AuthenticationToken token = Property.createInstanceFromPropertyName(conf, Property.TRACE_TOKEN_TYPE, AuthenticationToken.class, new PasswordToken()); token.init(props);