/** * Returns a transformer to be applied to all operations that operate on an existing resource. * This is typically used to adapt legacy operations to conform to the current version of the model. * @return an operation handler transformer. */ default UnaryOperator<OperationStepHandler> getOperationTransformation() { return UnaryOperator.identity(); } }
/** * Creates a new capability based on the specified requirement * @param requirement the requirement basis */ public RequirementCapability(Requirement requirement) { this(requirement, UnaryOperator.identity()); }
public void replaceArguments(UnaryOperator<Variable> f) { if (arguments != null) { for (int i = 0; i < arguments.length; ++i) { arguments[i] = f.apply(arguments[i]); } } }
/** * Constructs a new LegacyPropertyWriteOperationTransformer with no address transformation. */ public LegacyPropertyWriteOperationTransformer() { this(UnaryOperator.identity()); }
PlainAuthTokenResourceDefinition() { super(PATH, UnaryOperator.identity(), PlainAuthTokenServiceConfigurator::new); } }
/** * @since 10.0 - Overridden for efficiency */ @Override public void replaceAll(UnaryOperator<T> operator) { this.element1 = operator.apply(this.element1); this.element2 = operator.apply(this.element2); this.element3 = operator.apply(this.element3); this.element4 = operator.apply(this.element4); }
ProtocolRegistration(ResourceServiceConfiguratorFactory parentServiceConfiguratorFactory) { this.parentServiceConfiguratorFactory = parentServiceConfiguratorFactory; this.configurator = UnaryOperator.identity(); }
/** * @since 10.0 - Overridden for efficiency */ @Override public void replaceAll(UnaryOperator<T> operator) { this.element1 = operator.apply(this.element1); this.element2 = operator.apply(this.element2); this.element3 = operator.apply(this.element3); this.element4 = operator.apply(this.element4); }
@Override public Map<String, Optional<Partition>> getPartitionsByNames(String databaseName, String tableName, List<String> partitionNames) { requireNonNull(partitionNames, "partitionNames is null"); if (partitionNames.isEmpty()) { return ImmutableMap.of(); } Map<String, List<String>> partitionNameToPartitionValuesMap = partitionNames.stream() .collect(Collectors.toMap(identity(), HiveUtil::toPartitionValues)); Map<List<String>, Partition> partitionValuesToPartitionMap = delegate.getPartitionsByNames(databaseName, tableName, partitionNames).stream() .map(ThriftMetastoreUtil::fromMetastoreApiPartition) .collect(Collectors.toMap(Partition::getValues, identity())); ImmutableMap.Builder<String, Optional<Partition>> resultBuilder = ImmutableMap.builder(); for (Map.Entry<String, List<String>> entry : partitionNameToPartitionValuesMap.entrySet()) { Partition partition = partitionValuesToPartitionMap.get(entry.getValue()); resultBuilder.put(entry.getKey(), Optional.ofNullable(partition)); } return resultBuilder.build(); }
/** * @since 10.0 - Overridden for efficiency */ @Override public void replaceAll(UnaryOperator<T> operator) { this.element1 = operator.apply(this.element1); }
/** * Create a SASL client using the given URI and configuration from the given SASL client factory. * * @param uri the target URI (must not be {@code null}) * @param configuration the authentication configuration (must not be {@code null}) * @param offeredMechanisms the available mechanisms (must not be {@code null}) * @return the SASL client, or {@code null} if no clients were available or could be configured */ public SaslClient createSaslClient(URI uri, AuthenticationConfiguration configuration, Collection<String> offeredMechanisms) throws SaslException { return createSaslClient(uri, configuration, offeredMechanisms, UnaryOperator.identity()); }
/** * Create the mechanism instance. * * @param name the mechanism name (must not be {@code null}) * @return the mechanism, or {@code null} if the mechanism with the given name is not supported * @throws E if the mechanism instantiation failed */ default M createMechanism(String name) throws E { return createMechanism(name, UnaryOperator.identity()); }
/** * <pre> * Ex: Partition keys = ['a', 'b'] * Partition names = ['a=1/b=2', 'a=2/b=2'] * </pre> * * @param partitionNames List of full partition names * @return Mapping of partition name to partition object */ @Override public Map<String, Optional<Partition>> getPartitionsByNames(String databaseName, String tableName, List<String> partitionNames) { requireNonNull(partitionNames, "partitionNames is null"); if (partitionNames.isEmpty()) { return ImmutableMap.of(); } List<Partition> partitions = batchGetPartition(databaseName, tableName, partitionNames); Map<String, List<String>> partitionNameToPartitionValuesMap = partitionNames.stream() .collect(toMap(identity(), HiveUtil::toPartitionValues)); Map<List<String>, Partition> partitionValuesToPartitionMap = partitions.stream() .collect(toMap(Partition::getValues, identity())); ImmutableMap.Builder<String, Optional<Partition>> resultBuilder = ImmutableMap.builder(); for (Entry<String, List<String>> entry : partitionNameToPartitionValuesMap.entrySet()) { Partition partition = partitionValuesToPartitionMap.get(entry.getValue()); resultBuilder.put(entry.getKey(), Optional.ofNullable(partition)); } return resultBuilder.build(); }
/** * @since 10.0 - Provided for convenience for array based containers */ public static <T> void replaceAll(T[] items, int size, UnaryOperator<T> operator) { for (int i = 0; i < size; i++) { T item = items[i]; items[i] = operator.apply(item); } } }
RandomElectionPolicyResourceDefinition() { super(PATH, SingletonExtension.SUBSYSTEM_RESOLVER.createChildResolver(PATH, WILDCARD_PATH), UnaryOperator.identity(), RandomElectionPolicyServiceConfigurator::new); } }