Refine search
canonical example by Tabnine
canonical example by Tabnine
private List<SyncHandlerMethodArgumentResolver> initBinderResolvers( ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry reactiveRegistry, ConfigurableApplicationContext context) { return initResolvers(customResolvers, reactiveRegistry, context, false, Collections.emptyList()).stream() .filter(resolver -> resolver instanceof SyncHandlerMethodArgumentResolver) .map(resolver -> (SyncHandlerMethodArgumentResolver) resolver) .collect(Collectors.toList()); }
/** * Provide the TaskScheduler to use for SockJS endpoints for which a task * scheduler has not been explicitly registered. This method must be called * prior to {@link #getHandlerMapping()}. */ protected void setTaskScheduler(TaskScheduler scheduler) { this.registrations.stream() .map(ServletWebSocketHandlerRegistration::getSockJsServiceRegistration) .filter(Objects::nonNull) .filter(r -> r.getTaskScheduler() == null) .forEach(registration -> registration.setTaskScheduler(scheduler)); }
@Override @Nullable public CorsConfiguration getCorsConfiguration(ServerWebExchange exchange) { PathContainer lookupPath = exchange.getRequest().getPath().pathWithinApplication(); return this.corsConfigurations.entrySet().stream() .filter(entry -> entry.getKey().matches(lookupPath)) .map(Map.Entry::getValue) .findFirst() .orElse(null); }
public List<Symbol> getOriginalNonDistinctAggregateArgs() { return aggregations.values().stream() .filter(aggregation -> !aggregation.getMask().isPresent()) .map(Aggregation::getCall) .flatMap(function -> function.getArguments().stream()) .distinct() .map(Symbol::from) .collect(Collectors.toList()); }
@Override public Map<String, PartitionStatistics> getPartitionStatistics(String databaseName, String tableName, Set<String> partitionNames) { List<HivePartitionName> partitions = partitionNames.stream() .map(partitionName -> HivePartitionName.hivePartitionName(databaseName, tableName, partitionName)) .collect(toImmutableList()); Map<HivePartitionName, PartitionStatistics> statistics = getAll(partitionStatisticsCache, partitions); return statistics.entrySet() .stream() .collect(toImmutableMap(entry -> entry.getKey().getPartitionName().get(), Entry::getValue)); }
@Override public synchronized void notify(List<URL> urls) { List<URL> categoryUrls = urls.stream() .filter(this::isValidCategory) .filter(this::isNotCompatibleFor26x) .collect(Collectors.toList()); /** * TODO Try to refactor the processing of these three type of urls using Collectors.groupBy()? */ this.configurators = Configurator.toConfigurators(classifyUrls(categoryUrls, UrlUtils::isConfigurator)) .orElse(configurators); toRouters(classifyUrls(categoryUrls, UrlUtils::isRoute)).ifPresent(this::addRouters); // providers refreshOverrideAndInvoker(classifyUrls(categoryUrls, UrlUtils::isProvider)); }
private synchronized Collection<HivePrivilegeInfo> getTablePrivileges( Path permissionsDirectory, String principalName, PrincipalType principalType) { Path permissionFilePath = getPermissionsPath(permissionsDirectory, principalName, principalType); return readFile("permissions", permissionFilePath, permissionsCodec).orElse(ImmutableList.of()).stream() .map(PermissionMetadata::toHivePrivilegeInfo) .collect(toList()); }
private static PlanFragment createExchangePlanFragment(String name, PlanFragment... fragments) { PlanNode planNode = new RemoteSourceNode( new PlanNodeId(name + "_id"), Stream.of(fragments) .map(PlanFragment::getId) .collect(toImmutableList()), fragments[0].getPartitioningScheme().getOutputLayout(), Optional.empty(), REPARTITION); return createFragment(planNode); }
@VisibleForTesting public Supplier<PageProcessor> createPageProcessor(Page filterTuple, OptionalInt initialBatchSize) { TuplePageFilter filter = new TuplePageFilter(filterTuple, filterTypes, outputFilterChannels); return () -> new PageProcessor( Optional.of(filter), outputProjections.stream() .map(Supplier::get) .collect(toImmutableList()), initialBatchSize); }
private Set<NullableValue> filterValues(Set<NullableValue> nullableValues, TpchColumn<?> column, Constraint<ColumnHandle> constraint) { return nullableValues.stream() .filter(convertToPredicate(constraint.getSummary(), toColumnHandle(column))) .filter(value -> !constraint.predicate().isPresent() || constraint.predicate().get().test(ImmutableMap.of(toColumnHandle(column), value))) .collect(toSet()); }
public List<SchemaTableName> listTables(Optional<String> schemaName) { return tableDescriptions.getAllSchemaTableNames() .stream() .filter(schemaTableName -> !schemaName.isPresent() || schemaTableName.getSchemaName().equals(schemaName.get())) .collect(toImmutableList()); }
private static TypeSignature makeSignature(List<Field> fields) { int size = fields.size(); if (size == 0) { throw new IllegalArgumentException("Row type must have at least 1 field"); } List<TypeSignatureParameter> parameters = fields.stream() .map(field -> TypeSignatureParameter.of(new NamedTypeSignature(field.getName().map(name -> new RowFieldName(name, false)), field.getType().getTypeSignature()))) .collect(Collectors.toList()); return new TypeSignature(ROW, parameters); }