Interface Service<I,R>
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
Service.DirectoryService<I>
- All Known Implementing Classes:
ServiceRegistry,TinkerDegreeCentralityFactory,TinkerServiceRegistry,TinkerServiceRegistry.LambdaBarrierService,TinkerServiceRegistry.LambdaStartService,TinkerServiceRegistry.LambdaStreamingService,TinkerServiceRegistry.TinkerService,TinkerTextSearchFactory
Service call with I input type and R return type. Services can return
Traversers or raw values (which will be
converted into Traversers by CallStep.- Author:
- Mike Personick (http://github.com/mikepersonick)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceMeta-service to list and describe registered callable services.static interfacestatic classContext information for service call invocation.static interfaceThe service factory creates instances of callable services based on the desired execution type.static enumService calls can appear at the start of a traversal or mid-traversal. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Services can implement cleanup/shutdown procedures here.default CloseableIterator<R>execute(Service.ServiceCallContext ctx, Map params) Execute a Start service call.default CloseableIterator<R>execute(Service.ServiceCallContext ctx, Traverser.Admin<I> in, Map params) Execute a Streaming service call with one upstream input.default CloseableIterator<R>execute(Service.ServiceCallContext ctx, TraverserSet<I> in, Map params) Execute a Barrier service call with all upstream input.default intReturn the max barrier size.default Set<TraverserRequirement>Return anyTraverserRequirements necessary for this service call.getType()Return theService.Typeof service call.default booleanTrue if Barrier type.default booleanisStart()True if Start type.default booleanTrue if Streaming type.
-
Method Details
-
getType
Service.Type getType()Return theService.Typeof service call. -
getRequirements
Return anyTraverserRequirements necessary for this service call. -
isStart
default boolean isStart()True if Start type. -
isStreaming
default boolean isStreaming()True if Streaming type. -
isBarrier
default boolean isBarrier()True if Barrier type. -
getMaxBarrierSize
default int getMaxBarrierSize()Return the max barrier size. Default is all upstream solutions. -
execute
Execute a Start service call. -
execute
default CloseableIterator<R> execute(Service.ServiceCallContext ctx, Traverser.Admin<I> in, Map params) Execute a Streaming service call with one upstream input. -
execute
default CloseableIterator<R> execute(Service.ServiceCallContext ctx, TraverserSet<I> in, Map params) Execute a Barrier service call with all upstream input. -
close
default void close()Services can implement cleanup/shutdown procedures here.- Specified by:
closein interfaceAutoCloseable
-