@Override
        public Service<I, R> createService(final boolean isStart, final Map params) {
            if (isStart) {
                if (supports(Type.Start)) {
                    return getService(Type.Start, params);
                } else {
                    throw new UnsupportedOperationException(Service.Exceptions.cannotStartTraversal);
                }
            } else {
                if (supports(Type.Streaming, Type.Barrier)) {
                    /*
                     * This service supports both barrier and streaming execution. Look to the parameters for guidance.
                     */
                    final Type type = (Type) params.getOrDefault(Options.TYPE, Options.DEFAULT_TYPE);
                    return getService(type, params);
                } else if (supports(Type.Streaming)) {
                    return getService(Type.Streaming, params);
                } else if (supports(Type.Barrier)) {
                    return getService(Type.Barrier, params);
                } else {
                    throw new UnsupportedOperationException(Service.Exceptions.cannotUseMidTraversal);
                }
            }
        }
Dynamic configuration of chunk size for barriers.
tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/services/TinkerServiceRegistry.java