public TransportCreateSnapshotAction transportCreateSnapshotAction() {
   return transportCreateSnapshotActionProvider.get();
 }
 public TransportDeleteRepositoryAction transportDeleteRepositoryAction() {
   return transportDeleteRepositoryActionProvider.get();
 }
 public TransportSQLAction transportSQLAction() {
   return transportSQLActionProvider.get();
 }
 public TransportUpdateSettingsAction transportUpdateSettingsAction() {
   return transportUpdateSettingsActionProvider.get();
 }
 public TransportKillJobsNodeAction transportKillJobsNodeAction() {
   return transportKillJobsNodeActionProvider.get();
 }
 public TransportBulkCreateIndicesAction transportBulkCreateIndicesAction() {
   return transportBulkCreateIndicesActionProvider.get();
 }
 public TransportRefreshAction transportRefreshAction() {
   return transportRefreshActionProvider.get();
 }
 public TransportJobAction transportJobInitAction() {
   return transportJobInitActionProvider.get();
 }
 public TransportFetchNodeAction transportFetchNodeAction() {
   return transportFetchNodeActionProvider.get();
 }
 public BulkRequestExecutor<ShardUpsertRequest, ShardUpsertResponse>
     transportShardUpsertActionDelegate() {
   return new TransportShardUpsertActionDelegateImpl(transportShardUpsertActionProvider.get());
 }
 public BulkRequestExecutor<SymbolBasedShardUpsertRequest, ShardUpsertResponse>
     symbolBasedTransportShardUpsertActionDelegate() {
   return new SymbolBasedTransportShardUpsertActionDelegateImpl(
       symbolBasedTransportShardUpsertActionProvider.get());
 }
 public TransportMultiGetAction transportMultiGetAction() {
   return transportMultiGetActionProvider.get();
 }
 public TransportDeleteAction transportDeleteAction() {
   return transportDeleteActionProvider.get();
 }
 public TransportPutIndexTemplateAction transportPutIndexTemplateAction() {
   return transportPutIndexTemplateActionProvider.get();
 }
 public TransportRestoreSnapshotAction transportRestoreSnapshotAction() {
   return transportRestoreSnapshotActionProvider.get();
 }
 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);
    }
 public TransportCreateIndexAction transportCreateIndexAction() {
   return transportCreateIndexActionProvider.get();
 }