예제 #1
0
 public TransportCreateSnapshotAction transportCreateSnapshotAction() {
   return transportCreateSnapshotActionProvider.get();
 }
예제 #2
0
 public TransportDeleteRepositoryAction transportDeleteRepositoryAction() {
   return transportDeleteRepositoryActionProvider.get();
 }
예제 #3
0
 public TransportSQLAction transportSQLAction() {
   return transportSQLActionProvider.get();
 }
예제 #4
0
 public TransportUpdateSettingsAction transportUpdateSettingsAction() {
   return transportUpdateSettingsActionProvider.get();
 }
예제 #5
0
 public TransportKillJobsNodeAction transportKillJobsNodeAction() {
   return transportKillJobsNodeActionProvider.get();
 }
예제 #6
0
 public TransportBulkCreateIndicesAction transportBulkCreateIndicesAction() {
   return transportBulkCreateIndicesActionProvider.get();
 }
예제 #7
0
 public TransportRefreshAction transportRefreshAction() {
   return transportRefreshActionProvider.get();
 }
예제 #8
0
 public TransportJobAction transportJobInitAction() {
   return transportJobInitActionProvider.get();
 }
예제 #9
0
 public TransportFetchNodeAction transportFetchNodeAction() {
   return transportFetchNodeActionProvider.get();
 }
예제 #10
0
 public BulkRequestExecutor<ShardUpsertRequest, ShardUpsertResponse>
     transportShardUpsertActionDelegate() {
   return new TransportShardUpsertActionDelegateImpl(transportShardUpsertActionProvider.get());
 }
예제 #11
0
 public BulkRequestExecutor<SymbolBasedShardUpsertRequest, ShardUpsertResponse>
     symbolBasedTransportShardUpsertActionDelegate() {
   return new SymbolBasedTransportShardUpsertActionDelegateImpl(
       symbolBasedTransportShardUpsertActionProvider.get());
 }
예제 #12
0
 public TransportMultiGetAction transportMultiGetAction() {
   return transportMultiGetActionProvider.get();
 }
예제 #13
0
 public TransportDeleteAction transportDeleteAction() {
   return transportDeleteActionProvider.get();
 }
예제 #14
0
 public TransportPutIndexTemplateAction transportPutIndexTemplateAction() {
   return transportPutIndexTemplateActionProvider.get();
 }
예제 #15
0
 public TransportRestoreSnapshotAction transportRestoreSnapshotAction() {
   return transportRestoreSnapshotActionProvider.get();
 }
예제 #16
0
 public TransportPutMappingAction transportPutMappingAction() {
   return transportPutMappingActionProvider.get();
 }
예제 #17
0
    @Override
    protected void configure() {
      functionBinder =
          MapBinder.newMapBinder(binder(), FunctionIdent.class, FunctionImplementation.class);
      functionBinder.addBinding(TestFunction.ident).toInstance(new TestFunction());
      bind(Functions.class).asEagerSingleton();
      bind(ReferenceInfos.class).toInstance(mock(ReferenceInfos.class));
      bind(ThreadPool.class).toInstance(testThreadPool);

      BulkRetryCoordinator bulkRetryCoordinator = mock(BulkRetryCoordinator.class);
      BulkRetryCoordinatorPool bulkRetryCoordinatorPool = mock(BulkRetryCoordinatorPool.class);
      when(bulkRetryCoordinatorPool.coordinator(any(ShardId.class)))
          .thenReturn(bulkRetryCoordinator);
      bind(BulkRetryCoordinatorPool.class).toInstance(bulkRetryCoordinatorPool);

      bind(TransportBulkCreateIndicesAction.class)
          .toInstance(mock(TransportBulkCreateIndicesAction.class));
      bind(CircuitBreakerService.class).toInstance(new NoneCircuitBreakerService());
      bind(ActionFilters.class).toInstance(mock(ActionFilters.class));
      bind(ScriptService.class).toInstance(mock(ScriptService.class));
      bind(SearchService.class).toInstance(mock(InternalSearchService.class));
      bind(AllocationService.class).toInstance(mock(AllocationService.class));
      bind(MetaDataCreateIndexService.class).toInstance(mock(MetaDataCreateIndexService.class));
      bind(DynamicSettings.class)
          .annotatedWith(ClusterDynamicSettings.class)
          .toInstance(mock(DynamicSettings.class));
      bind(MetaDataDeleteIndexService.class).toInstance(mock(MetaDataDeleteIndexService.class));
      bind(ClusterInfoService.class).toInstance(mock(ClusterInfoService.class));
      bind(TransportService.class).toInstance(mock(TransportService.class));
      bind(MapperService.class).toInstance(mock(MapperService.class));

      OsService osService = mock(OsService.class);
      OsStats osStats = mock(OsStats.class);
      when(osService.stats()).thenReturn(osStats);
      OsStats.Cpu osCpu = mock(OsStats.Cpu.class);
      when(osCpu.stolen()).thenReturn((short) 1);
      when(osStats.cpu()).thenReturn(osCpu);

      bind(OsService.class).toInstance(osService);
      bind(NodeService.class).toInstance(mock(NodeService.class));
      bind(Discovery.class).toInstance(mock(Discovery.class));
      bind(NetworkService.class).toInstance(mock(NetworkService.class));

      bind(TransportShardBulkAction.class).toInstance(mock(TransportShardBulkAction.class));
      bind(TransportCreateIndexAction.class).toInstance(mock(TransportCreateIndexAction.class));

      discoveryService = mock(DiscoveryService.class);
      DiscoveryNode discoveryNode = mock(DiscoveryNode.class);
      when(discoveryNode.id()).thenReturn(TEST_NODE_ID);
      when(discoveryService.localNode()).thenReturn(discoveryNode);

      ClusterService clusterService = mock(ClusterService.class);
      ClusterState state = mock(ClusterState.class);
      DiscoveryNodes discoveryNodes = mock(DiscoveryNodes.class);
      when(discoveryNodes.localNodeId()).thenReturn(TEST_NODE_ID);
      when(state.nodes()).thenReturn(discoveryNodes);
      when(clusterService.state()).thenReturn(state);
      when(clusterService.localNode()).thenReturn(discoveryNode);
      bind(ClusterService.class).toInstance(clusterService);

      IndicesService indicesService = mock(IndicesService.class);
      bind(IndicesService.class).toInstance(indicesService);
      bind(Settings.class).toInstance(ImmutableSettings.EMPTY);

      bind(MetaDataUpdateSettingsService.class)
          .toInstance(mock(MetaDataUpdateSettingsService.class));
      bind(Client.class).toInstance(mock(Client.class));

      Provider<TransportCreateIndexAction> transportCreateIndexActionProvider =
          mock(Provider.class);
      when(transportCreateIndexActionProvider.get())
          .thenReturn(mock(TransportCreateIndexAction.class));
      Provider<TransportDeleteIndexAction> transportDeleteActionProvider = mock(Provider.class);
      when(transportDeleteActionProvider.get()).thenReturn(mock(TransportDeleteIndexAction.class));
      Provider<TransportUpdateSettingsAction> transportUpdateSettingsActionProvider =
          mock(Provider.class);
      when(transportUpdateSettingsActionProvider.get())
          .thenReturn(mock(TransportUpdateSettingsAction.class));

      BlobIndices blobIndices =
          new BlobIndices(
              ImmutableSettings.EMPTY,
              transportCreateIndexActionProvider,
              transportDeleteActionProvider,
              transportUpdateSettingsActionProvider,
              indicesService,
              mock(IndicesLifecycle.class),
              mock(BlobEnvironment.class),
              clusterService);
      bind(BlobIndices.class).toInstance(blobIndices);

      bind(ReferenceResolver.class).to(GlobalReferenceResolver.class);

      TransportPutIndexTemplateAction transportPutIndexTemplateAction =
          mock(TransportPutIndexTemplateAction.class);
      bind(TransportPutIndexTemplateAction.class).toInstance(transportPutIndexTemplateAction);

      bind(IndexService.class).toInstance(indexService);
    }
예제 #18
0
 public TransportCreateIndexAction transportCreateIndexAction() {
   return transportCreateIndexActionProvider.get();
 }