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
public interface Service<I,R> extends AutoCloseable
Service call with I input type and R return type. Services can returnTraverser
s or raw values (which will be converted into Traversers byCallStep
.- Author:
- Mike Personick (http://github.com/mikepersonick)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Service.DirectoryService<I>
Meta-service to list and describe registered callable services.static interface
Service.Exceptions
static class
Service.ServiceCallContext
Context information for service call invocation.static interface
Service.ServiceFactory<I,R>
The service factory creates instances of callable services based on the desired execution type.static class
Service.Type
Service calls can appear at the start of a traversal or mid-traversal.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
close()
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 int
getMaxBarrierSize()
Return the max barrier size.default Set<TraverserRequirement>
getRequirements()
Return anyTraverserRequirement
s necessary for this service call.Service.Type
getType()
Return theService.Type
of service call.default boolean
isBarrier()
True if Barrier type.default boolean
isStart()
True if Start type.default boolean
isStreaming()
True if Streaming type.
-
-
-
Method Detail
-
getType
Service.Type getType()
Return theService.Type
of service call.
-
getRequirements
default Set<TraverserRequirement> getRequirements()
Return anyTraverserRequirement
s 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
default CloseableIterator<R> execute(Service.ServiceCallContext ctx, Map params)
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:
close
in interfaceAutoCloseable
-
-