io.netty.channel.FixedRecvByteBufAllocator#org.elasticsearch.common.io.stream.NamedWriteableRegistry源码实例Demo

下面列出了io.netty.channel.FixedRecvByteBufAllocator#org.elasticsearch.common.io.stream.NamedWriteableRegistry 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@Override
public Map<String, Supplier<HttpServerTransport>> getHttpTransports(Settings settings, ThreadPool threadPool, BigArrays bigArrays,
        CircuitBreakerService circuitBreakerService, NamedWriteableRegistry namedWriteableRegistry,
        NamedXContentRegistry xContentRegistry, NetworkService networkService, Dispatcher dispatcher) {
    
    final Map<String, Supplier<HttpServerTransport>> httpTransports = new HashMap<String, Supplier<HttpServerTransport>>(1);
    if (!client && httpSSLEnabled) {
        
        final ValidatingDispatcher validatingDispatcher = new ValidatingDispatcher(threadPool.getThreadContext(), dispatcher, settings, configPath, NOOP_SSL_EXCEPTION_HANDLER);
        final OpenDistroSecuritySSLNettyHttpServerTransport sgsnht = new OpenDistroSecuritySSLNettyHttpServerTransport(settings, networkService, bigArrays, threadPool, odsks, xContentRegistry, validatingDispatcher, NOOP_SSL_EXCEPTION_HANDLER);
        
        httpTransports.put("com.amazon.opendistroforelasticsearch.security.ssl.http.netty.OpenDistroSecuritySSLNettyHttpServerTransport", () -> sgsnht);
        
    }
    return httpTransports;
}
 
@Override
public Collection<Object> createComponents(Client client,
                                           ClusterService clusterService,
                                           ThreadPool threadPool,
                                           ResourceWatcherService resourceWatcherService,
                                           ScriptService scriptService,
                                           NamedXContentRegistry xContentRegistry,
                                           Environment environment,
                                           NodeEnvironment nodeEnvironment,
                                           NamedWriteableRegistry namedWriteableRegistry,
                                           IndexNameExpressionResolver indexNameExpressionResolver) {
    clusterService.addListener(event -> {
        for (Index i : event.indicesDeleted()) {
            if (IndexFeatureStore.isIndexStore(i.getName())) {
                caches.evict(i.getName());
            }
        }
    });
    return asList(caches, parserFactory);
}
 
源代码3 项目: elasticsearch-dynarank   文件: DynamicRanker.java
@Inject
public DynamicRanker(final Settings settings, final Client client, final ClusterService clusterService,
        final ScriptService scriptService, final ThreadPool threadPool, final ActionFilters filters,
        final NamedWriteableRegistry namedWriteableRegistry) {
    this.client = client;
    this.clusterService = clusterService;
    this.scriptService = scriptService;
    this.threadPool = threadPool;
    this.namedWriteableRegistry = namedWriteableRegistry;

    logger.info("Initializing DynamicRanker");

    final TimeValue expire = SETTING_DYNARANK_CACHE_EXPIRE.get(settings);
    cleanInterval = SETTING_DYNARANK_CACHE_CLEAN_INTERVAL.get(settings);

    final CacheBuilder<Object, Object> builder = CacheBuilder.newBuilder().concurrencyLevel(16);
    if (expire.millis() >= 0) {
        builder.expireAfterAccess(expire.millis(), TimeUnit.MILLISECONDS);
    }
    scriptInfoCache = builder.build();
}
 
源代码4 项目: crate   文件: Netty4Plugin.java
@Override
public Map<String, Supplier<Transport>> getTransports(Settings settings,
                                                      ThreadPool threadPool,
                                                      BigArrays bigArrays,
                                                      PageCacheRecycler pageCacheRecycler,
                                                      CircuitBreakerService circuitBreakerService,
                                                      NamedWriteableRegistry namedWriteableRegistry,
                                                      NetworkService networkService) {
    return Collections.singletonMap(
        NETTY_TRANSPORT_NAME,
        () -> new Netty4Transport(
            settings,
            threadPool,
            networkService,
            bigArrays,
            namedWriteableRegistry,
            circuitBreakerService
        )
    );
}
 
源代码5 项目: crate   文件: Netty4Plugin.java
@Override
public Map<String, Supplier<HttpServerTransport>> getHttpTransports(Settings settings, ThreadPool threadPool, BigArrays bigArrays,
                                                                    CircuitBreakerService circuitBreakerService,
                                                                    NamedWriteableRegistry namedWriteableRegistry,
                                                                    NamedXContentRegistry xContentRegistry,
                                                                    NetworkService networkService,
                                                                    NodeClient nodeClient) {
    return Collections.singletonMap(
        NETTY_HTTP_TRANSPORT_NAME,
        () -> new Netty4HttpServerTransport(
            settings,
            networkService,
            bigArrays,
            threadPool,
            xContentRegistry,
            pipelineRegistry,
            nodeClient
        )
    );
}
 
源代码6 项目: crate   文件: PublicationTransportHandler.java
public PublicationTransportHandler(TransportService transportService, NamedWriteableRegistry namedWriteableRegistry,
                                   Function<PublishRequest, PublishWithJoinResponse> handlePublishRequest,
                                   BiConsumer<ApplyCommitRequest, ActionListener<Void>> handleApplyCommit) {
    this.transportService = transportService;
    this.namedWriteableRegistry = namedWriteableRegistry;
    this.handlePublishRequest = handlePublishRequest;

    transportService.registerRequestHandler(
        PUBLISH_STATE_ACTION_NAME,
        BytesTransportRequest::new,
        ThreadPool.Names.GENERIC,
        false,
        false,
        (request, channel, task) -> channel.sendResponse(handleIncomingPublishRequest(request))
    );

    transportService.registerRequestHandler(
        COMMIT_STATE_ACTION_NAME,
        ThreadPool.Names.GENERIC,
        false,
        false,
        ApplyCommitRequest::new,
        (request, channel, task) -> handleApplyCommit.accept(request, transportCommitCallback(channel))
    );
}
 
源代码7 项目: crate   文件: MockTcpTransport.java
public MockTcpTransport(Settings settings, ThreadPool threadPool, BigArrays bigArrays,
                        CircuitBreakerService circuitBreakerService, NamedWriteableRegistry namedWriteableRegistry,
                        NetworkService networkService, Version mockVersion) {
    super("mock-tcp-transport",
          settings,
          threadPool,
          bigArrays,
          circuitBreakerService,
          namedWriteableRegistry,
          networkService);
    // we have our own crazy cached threadpool this one is not bounded at all...
    // using the ES thread factory here is crucial for tests otherwise disruption tests won't block that thread
    executor = Executors.newCachedThreadPool(EsExecutors.daemonThreadFactory(settings,
                                                                             Transports.TEST_MOCK_TRANSPORT_THREAD_PREFIX));
    this.mockVersion = mockVersion;
}
 
源代码8 项目: crate   文件: DiffableTestUtils.java
/**
 * Tests making random changes to an object, calculating diffs for these changes, sending this
 * diffs over the wire and appling these diffs on the other side.
 */
public static <T extends Diffable<T>> void testDiffableSerialization(Supplier<T> testInstance,
                                                                     Function<T, T> modifier,
                                                                     NamedWriteableRegistry namedWriteableRegistry,
                                                                     Reader<T> reader,
                                                                     Reader<Diff<T>> diffReader) throws IOException {
    T remoteInstance = testInstance.get();
    T localInstance = assertSerialization(remoteInstance, namedWriteableRegistry, reader);
    for (int runs = 0; runs < NUMBER_OF_DIFF_TEST_RUNS; runs++) {
        T remoteChanges = modifier.apply(remoteInstance);
        Diff<T> remoteDiffs = remoteChanges.diff(remoteInstance);
        Diff<T> localDiffs = copyInstance(remoteDiffs, namedWriteableRegistry, diffReader);
        localInstance = assertDiffApplication(remoteChanges, localInstance, localDiffs);
        remoteInstance = remoteChanges;
    }
}
 
源代码9 项目: crate   文件: EnterpriseUsersExtension.java
@Override
public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
    List<NamedWriteableRegistry.Entry> entries = new ArrayList<>(4);
    entries.add(new NamedWriteableRegistry.Entry(
        MetaData.Custom.class,
        UsersMetaData.TYPE,
        UsersMetaData::new
    ));
    entries.add(new NamedWriteableRegistry.Entry(
        NamedDiff.class,
        UsersMetaData.TYPE,
        in -> UsersMetaData.readDiffFrom(MetaData.Custom.class, UsersMetaData.TYPE, in)
    ));

    entries.add(new NamedWriteableRegistry.Entry(
        MetaData.Custom.class,
        UsersPrivilegesMetaData.TYPE,
        UsersPrivilegesMetaData::new
    ));
    entries.add(new NamedWriteableRegistry.Entry(
        NamedDiff.class,
        UsersPrivilegesMetaData.TYPE,
        in -> UsersPrivilegesMetaData.readDiffFrom(MetaData.Custom.class, UsersPrivilegesMetaData.TYPE, in)
    ));
    return entries;
}
 
@Override
public List<TransportInterceptor> getTransportInterceptors(NamedWriteableRegistry namedWriteableRegistry, ThreadContext threadContext) {
    List<TransportInterceptor> interceptors = new ArrayList<TransportInterceptor>(1);
    
    if(transportSSLEnabled && !client) {
        interceptors.add(new OpenDistroSecuritySSLTransportInterceptor(settings, null, null, NOOP_SSL_EXCEPTION_HANDLER));
    }
    
    return interceptors;
}
 
@Override
   public Map<String, Supplier<Transport>> getTransports(Settings settings, ThreadPool threadPool, PageCacheRecycler pageCacheRecycler,
        CircuitBreakerService circuitBreakerService, NamedWriteableRegistry namedWriteableRegistry, NetworkService networkService) { 
    Map<String, Supplier<Transport>> transports = new HashMap<String, Supplier<Transport>>();
    if (transportSSLEnabled) {
        transports.put("com.amazon.opendistroforelasticsearch.security.ssl.http.netty.OpenDistroSecuritySSLNettyTransport", 
                () -> new OpenDistroSecuritySSLNettyTransport(settings, Version.CURRENT, threadPool, networkService, pageCacheRecycler, namedWriteableRegistry, circuitBreakerService, odsks, NOOP_SSL_EXCEPTION_HANDLER));

    }
    return transports;

}
 
@Override
public Collection<Object> createComponents(Client localClient, ClusterService clusterService, ThreadPool threadPool,
        ResourceWatcherService resourceWatcherService, ScriptService scriptService, NamedXContentRegistry xContentRegistry,
        Environment environment, NodeEnvironment nodeEnvironment, NamedWriteableRegistry namedWriteableRegistry) {

    final List<Object> components = new ArrayList<>(1);
    
    if(client) {
        return components;
    }
    
    final String principalExtractorClass = settings.get(SSLConfigConstants.OPENDISTRO_SECURITY_SSL_TRANSPORT_PRINCIPAL_EXTRACTOR_CLASS, null);

    if(principalExtractorClass == null) {
        principalExtractor = new com.amazon.opendistroforelasticsearch.security.ssl.transport.DefaultPrincipalExtractor();
    } else {
        try {
            log.debug("Try to load and instantiate '{}'", principalExtractorClass);
            Class<?> principalExtractorClazz = Class.forName(principalExtractorClass);
            principalExtractor = (PrincipalExtractor) principalExtractorClazz.newInstance();
        } catch (Exception e) {
            log.error("Unable to load '{}' due to", principalExtractorClass, e);
            throw new ElasticsearchException(e);
        }
    }
    
    components.add(principalExtractor);
    
    return components;
}
 
public OpenDistroSecuritySSLNettyTransport(final Settings settings, final Version version, final ThreadPool threadPool, final NetworkService networkService,
    final PageCacheRecycler pageCacheRecycler, final NamedWriteableRegistry namedWriteableRegistry,
    final CircuitBreakerService circuitBreakerService, final OpenDistroSecurityKeyStore odks, final SslExceptionHandler errorHandler) {
    super(settings, version, threadPool, networkService, pageCacheRecycler, namedWriteableRegistry, circuitBreakerService);
    this.odks = odks;
    this.errorHandler = errorHandler;
}
 
源代码14 项目: presto-connectors   文件: Elasticsearch6Client.java
static NamedWriteableRegistry getNamedWriteableRegistry()
{
    IndicesModule indicesModule = new IndicesModule(Collections.emptyList());
    SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
    List<NamedWriteableRegistry.Entry> entries = new ArrayList<>();
    entries.addAll(indicesModule.getNamedWriteables());
    entries.addAll(searchModule.getNamedWriteables());
    return new NamedWriteableRegistry(entries);
}
 
源代码15 项目: presto-connectors   文件: Elasticsearch5Client.java
static NamedWriteableRegistry getNamedWriteableRegistry()
{
    IndicesModule indicesModule = new IndicesModule(Collections.emptyList());
    SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
    List<NamedWriteableRegistry.Entry> entries = new ArrayList<>();
    entries.addAll(indicesModule.getNamedWriteables());
    entries.addAll(searchModule.getNamedWriteables());
    return new NamedWriteableRegistry(entries);
}
 
源代码16 项目: Elasticsearch   文件: LocalTransport.java
@Inject
public LocalTransport(Settings settings, ThreadPool threadPool, Version version, NamedWriteableRegistry namedWriteableRegistry) {
    super(settings);
    this.threadPool = threadPool;
    this.version = version;
    int workerCount = this.settings.getAsInt(TRANSPORT_LOCAL_WORKERS, EsExecutors.boundedNumberOfProcessors(settings));
    int queueSize = this.settings.getAsInt(TRANSPORT_LOCAL_QUEUE, -1);
    logger.debug("creating [{}] workers, queue_size [{}]", workerCount, queueSize);
    final ThreadFactory threadFactory = EsExecutors.daemonThreadFactory(this.settings, LOCAL_TRANSPORT_THREAD_NAME_PREFIX);
    this.workers = EsExecutors.newFixed(LOCAL_TRANSPORT_THREAD_NAME_PREFIX, workerCount, queueSize, threadFactory);
    this.namedWriteableRegistry = namedWriteableRegistry;
}
 
源代码17 项目: Elasticsearch   文件: TransportModule.java
public TransportModule(Settings settings, NamedWriteableRegistry namedWriteableRegistry) {
    this.settings = settings;
    this.logger = Loggers.getLogger(getClass(), settings);
    addTransport(LOCAL_TRANSPORT, LocalTransport.class);
    addTransport(NETTY_TRANSPORT, NettyTransport.class);
    this.namedWriteableRegistry = namedWriteableRegistry;
}
 
@Override
public Map<String, Supplier<Transport>> getTransports(Settings settings, ThreadPool threadPool, BigArrays bigArrays,
        CircuitBreakerService circuitBreakerService, NamedWriteableRegistry namedWriteableRegistry,
        NetworkService networkService) {
    Map<String, Supplier<Transport>> transports = sgPlugin.getTransports(settings, threadPool, bigArrays, circuitBreakerService, namedWriteableRegistry,
            networkService);
    return transports;
}
 
@Override
public Map<String, Supplier<HttpServerTransport>> getHttpTransports(Settings settings, ThreadPool threadPool,
        BigArrays bigArrays, CircuitBreakerService circuitBreakerService,
        NamedWriteableRegistry namedWriteableRegistry, NamedXContentRegistry namedXContentRegistry,
        NetworkService networkService, Dispatcher dispatcher) {
    Map<String, Supplier<HttpServerTransport>> transports = sgPlugin.getHttpTransports(settings, threadPool, bigArrays, circuitBreakerService,
            namedWriteableRegistry, namedXContentRegistry, networkService, dispatcher);
    return transports;
}
 
源代码20 项目: ranger   文件: RangerElasticsearchPlugin.java
@Override
public Collection<Object> createComponents(final Client client, final ClusterService clusterService,
		final ThreadPool threadPool, final ResourceWatcherService resourceWatcherService,
		final ScriptService scriptService, final NamedXContentRegistry xContentRegistry,
		final Environment environment, final NodeEnvironment nodeEnvironment,
		final NamedWriteableRegistry namedWriteableRegistry) {

	addPluginConfig2Classpath(environment);

	rangerSecurityActionFilter = new RangerSecurityActionFilter(threadPool.getThreadContext());
	return Collections.singletonList(rangerSecurityActionFilter);
}
 
@Override
public Collection<Object> createComponents(Client client, ClusterService clusterService, ThreadPool threadPool,
        ResourceWatcherService resourceWatcherService, ScriptService scriptService,
        NamedXContentRegistry xContentRegistry, Environment environment,
        NodeEnvironment nodeEnvironment, NamedWriteableRegistry namedWriteableRegistry) {
    final Collection<Object> components = new ArrayList<>();
    components.add(pluginComponent);
    return components;
}
 
源代码22 项目: elasticsearch-plugin-bundle   文件: BundlePlugin.java
@Override
public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
    List<NamedWriteableRegistry.Entry> extra = new ArrayList<>();
    if (settings.getAsBoolean("plugins.xbib.icu.enabled", true)) {
        extra.add(new NamedWriteableRegistry.Entry(
                        DocValueFormat.class,
                        IcuCollationKeyFieldMapper.CollationFieldType.COLLATE_FORMAT.getWriteableName(),
                        in -> IcuCollationKeyFieldMapper.CollationFieldType.COLLATE_FORMAT
                )
        );
    }
    return extra;
}
 
源代码23 项目: elasticsearch-carrot2   文件: ClusteringPlugin.java
@Override
public Collection<Object> createComponents(Client client, ClusterService clusterService,
                                           ThreadPool threadPool, ResourceWatcherService resourceWatcherService,
                                           ScriptService scriptService, NamedXContentRegistry xContentRegistry,
                                           Environment environment, NodeEnvironment nodeEnvironment,
                                           NamedWriteableRegistry namedWriteableRegistry) {
   List<Object> components = new ArrayList<>();
   if (pluginEnabled && !transportClient) {
      components.add(new ClusteringContext(environment,
          reorderAlgorithms(algorithmProviders),
          new LinkedHashMap<>(languageComponentProviders)));
   }
   return components;
}
 
源代码24 项目: crate   文件: TcpTransport.java
public TcpTransport(String transportName, Settings settings, ThreadPool threadPool, BigArrays bigArrays,
                    CircuitBreakerService circuitBreakerService, NamedWriteableRegistry namedWriteableRegistry,
                    NetworkService networkService) {
    this.settings = settings;
    this.profileSettings = getProfileSettings(settings);
    this.threadPool = threadPool;
    this.bigArrays = bigArrays;
    this.circuitBreakerService = circuitBreakerService;
    this.namedWriteableRegistry = namedWriteableRegistry;
    this.compress = Transport.TRANSPORT_TCP_COMPRESS.get(settings);
    this.networkService = networkService;
    this.transportName = transportName;
    this.nodeName = Node.NODE_NAME_SETTING.get(settings);
    final Settings defaultFeatures = DEFAULT_FEATURES_SETTING.get(settings);
    if (defaultFeatures == null) {
        this.features = new String[0];
    } else {
        defaultFeatures.names().forEach(key -> {
            if (Booleans.parseBoolean(defaultFeatures.get(key)) == false) {
                throw new IllegalArgumentException("feature settings must have default [true] value");
            }
        });
        // use a sorted set to present the features in a consistent order
        this.features = new TreeSet<>(defaultFeatures.names()).toArray(new String[defaultFeatures.names().size()]);
    }

    try (BytesStreamOutput out = new BytesStreamOutput()) {
        out.writeByte((byte) 'E');
        out.writeByte((byte) 'S');
        out.writeInt(TcpTransport.PING_DATA_SIZE);
        pingMessage = out.bytes();
    } catch (IOException e) {
        throw new AssertionError(e.getMessage(), e); // won't happen
    }
}
 
源代码25 项目: crate   文件: Netty4Plugin.java
@Override
public Collection<Object> createComponents(Client client,
                                           ClusterService clusterService,
                                           ThreadPool threadPool,
                                           NamedXContentRegistry xContentRegistry,
                                           Environment environment,
                                           NodeEnvironment nodeEnvironment,
                                           NamedWriteableRegistry namedWriteableRegistry) {
    // pipelineRegistry is returned here so that it's bound in guice and can be injected in other places
    return Collections.singletonList(pipelineRegistry);
}
 
源代码26 项目: crate   文件: Coordinator.java
public Coordinator(String nodeName, Settings settings, ClusterSettings clusterSettings, TransportService transportService,
                   NamedWriteableRegistry namedWriteableRegistry, AllocationService allocationService, MasterService masterService,
                   Supplier<CoordinationState.PersistedState> persistedStateSupplier, SeedHostsProvider seedHostsProvider,
                   ClusterApplier clusterApplier, Collection<BiConsumer<DiscoveryNode, ClusterState>> onJoinValidators, Random random) {
    this.settings = settings;
    this.transportService = transportService;
    this.masterService = masterService;
    this.allocationService = allocationService;
    this.onJoinValidators = JoinTaskExecutor.addBuiltInJoinValidators(onJoinValidators);
    this.singleNodeDiscovery = DiscoveryModule.SINGLE_NODE_DISCOVERY_TYPE.equals(DiscoveryModule.DISCOVERY_TYPE_SETTING.get(settings));
    this.joinHelper = new JoinHelper(settings, allocationService, masterService, transportService,
        this::getCurrentTerm, this::getStateForMasterService, this::handleJoinRequest, this::joinLeaderInTerm, this.onJoinValidators);
    this.persistedStateSupplier = persistedStateSupplier;
    this.noMasterBlockService = new NoMasterBlockService(settings, clusterSettings);
    this.lastKnownLeader = Optional.empty();
    this.lastJoin = Optional.empty();
    this.joinAccumulator = new InitialJoinAccumulator();
    this.publishTimeout = PUBLISH_TIMEOUT_SETTING.get(settings);
    this.random = random;
    this.electionSchedulerFactory = new ElectionSchedulerFactory(settings, random, transportService.getThreadPool());
    this.preVoteCollector = new PreVoteCollector(transportService, this::startElection, this::updateMaxTermSeen);
    configuredHostsResolver = new SeedHostsResolver(nodeName, settings, transportService, seedHostsProvider);
    this.peerFinder = new CoordinatorPeerFinder(settings, transportService,
        new HandshakingTransportAddressConnector(settings, transportService), configuredHostsResolver);
    this.publicationHandler = new PublicationTransportHandler(transportService, namedWriteableRegistry,
        this::handlePublishRequest, this::handleApplyCommit);
    this.leaderChecker = new LeaderChecker(settings, transportService, getOnLeaderFailure());
    this.followersChecker = new FollowersChecker(settings, transportService, this::onFollowerCheckRequest, this::removeNode);
    this.nodeRemovalExecutor = new NodeRemovalClusterStateTaskExecutor(allocationService, LOGGER);
    this.clusterApplier = clusterApplier;
    masterService.setClusterStateSupplier(this::getStateForMasterService);
    this.reconfigurator = new Reconfigurator(settings, clusterSettings);
    this.clusterBootstrapService = new ClusterBootstrapService(settings, transportService, this::getFoundPeers,
        this::isInitialConfigurationSet, this::setInitialConfiguration);
    this.lagDetector = new LagDetector(settings, transportService.getThreadPool(), n -> removeNode(n, "lagging"),
        transportService::getLocalNode);
    this.clusterFormationFailureHelper = new ClusterFormationFailureHelper(settings, this::getClusterFormationState,
        transportService.getThreadPool(), joinHelper::logLastFailedJoinAttempt);
}
 
源代码27 项目: crate   文件: NetworkPlugin.java
/**
 * Returns a map of {@link Transport} suppliers.
 * See {@link org.elasticsearch.common.network.NetworkModule#TRANSPORT_TYPE_KEY} to configure a specific implementation.
 */
default Map<String, Supplier<Transport>> getTransports(Settings settings, ThreadPool threadPool, BigArrays bigArrays,
                                                       PageCacheRecycler pageCacheRecycler,
                                                       CircuitBreakerService circuitBreakerService,
                                                       NamedWriteableRegistry namedWriteableRegistry,
                                                       NetworkService networkService) {
    return Collections.emptyMap();
}
 
源代码28 项目: crate   文件: NetworkPlugin.java
/**
 * Returns a map of {@link HttpServerTransport} suppliers.
 * See {@link org.elasticsearch.common.network.NetworkModule#HTTP_TYPE_SETTING} to configure a specific implementation.
 */
default Map<String, Supplier<HttpServerTransport>> getHttpTransports(Settings settings,
                                                                     ThreadPool threadPool,
                                                                     BigArrays bigArrays,
                                                                     CircuitBreakerService circuitBreakerService,
                                                                     NamedWriteableRegistry namedWriteableRegistry,
                                                                     NamedXContentRegistry xContentRegistry,
                                                                     NetworkService networkService,
                                                                     NodeClient nodeClient) {
    return Collections.emptyMap();
}
 
源代码29 项目: crate   文件: SQLPlugin.java
@Override
public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
    List<NamedWriteableRegistry.Entry> entries = new ArrayList<>();
    entries.add(new NamedWriteableRegistry.Entry(
        MetaData.Custom.class,
        UserDefinedFunctionsMetaData.TYPE,
        UserDefinedFunctionsMetaData::new
    ));
    entries.add(new NamedWriteableRegistry.Entry(
        MetaData.Custom.class,
        ViewsMetaData.TYPE,
        ViewsMetaData::new
    ));
    entries.add(new NamedWriteableRegistry.Entry(
        NamedDiff.class,
        UserDefinedFunctionsMetaData.TYPE,
        in -> UserDefinedFunctionsMetaData.readDiffFrom(MetaData.Custom.class, UserDefinedFunctionsMetaData.TYPE, in)
    ));
    entries.add(new NamedWriteableRegistry.Entry(
        NamedDiff.class,
        ViewsMetaData.TYPE,
        in -> ViewsMetaData.readDiffFrom(MetaData.Custom.class, ViewsMetaData.TYPE, in)
    ));
    if (userExtension != null) {
        entries.addAll(userExtension.getNamedWriteables());
    }
    if (licenseExtension != null) {
        entries.addAll(licenseExtension.getNamedWriteables());
    }
    return entries;
}
 
源代码30 项目: crate   文件: MockTcpTransportPlugin.java
@Override
public Map<String, Supplier<Transport>> getTransports(Settings settings, ThreadPool threadPool, BigArrays bigArrays,
                                                      PageCacheRecycler pageCacheRecycler,
                                                      CircuitBreakerService circuitBreakerService,
                                                      NamedWriteableRegistry namedWriteableRegistry,
                                                      NetworkService networkService) {
    return Collections.singletonMap(MOCK_TCP_TRANSPORT_NAME,
        () -> new MockTcpTransport(settings, threadPool, bigArrays, circuitBreakerService, namedWriteableRegistry, networkService));
}