Package com.fasterxml.clustermate.api

Examples of com.fasterxml.clustermate.api.RequestPathBuilder


   
    protected String _buildNodeStatusUpdateUrl(ClusterViewByServerUpdatable cluster, IpAndPort remote,
            String state)
    {
        final KeyRange syncRange = cluster.getLocalState().totalRange();
        RequestPathBuilder pathBuilder = new JdkHttpClientPathBuilder(remote)
            .addPathSegments(_stuff.getServiceConfig().servicePathRoot);
        pathBuilder = _stuff.getPathStrategy().appendPath(pathBuilder, PathType.NODE_STATUS);
        pathBuilder = pathBuilder.addParameter(ClusterMateConstants.QUERY_PARAM_KEYRANGE_START, String.valueOf(syncRange.getStart()));
        pathBuilder = pathBuilder.addParameter(ClusterMateConstants.QUERY_PARAM_KEYRANGE_LENGTH, String.valueOf(syncRange.getLength()));
        pathBuilder = pathBuilder.addParameter(ClusterMateConstants.QUERY_PARAM_TIMESTAMP,
                String.valueOf(_stuff.getTimeMaster().currentTimeMillis()));
        pathBuilder = pathBuilder.addParameter(ClusterMateConstants.QUERY_PARAM_STATE, state);
        // this will include 'caller' param:
        pathBuilder = cluster.addClusterStateInfo(pathBuilder);
        return pathBuilder.toString();
    }
View Full Code Here


    }
   
    protected String _buildSyncPullUrl(IpAndPort endpoint)
    {
        final ServiceConfig config = _stuff.getServiceConfig();
        RequestPathBuilder pathBuilder = new JdkHttpClientPathBuilder(endpoint)
            .addPathSegments(config.servicePathRoot);
        pathBuilder = _stuff.getPathStrategy().appendPath(pathBuilder, PathType.SYNC_PULL);
        return pathBuilder.toString();
    }
View Full Code Here

        ServiceDispatchServlet<K,E> dispatcher = new ServiceDispatchServlet<K,E>(
                cluster, stuff,
                nodeStatusServlet, storeEntryServlet, null,
                syncListServlet, syncPullServlet);

        RequestPathBuilder rootBuilder = rootPath(stuff.getServiceConfig());
        String rootPath = servletPath(rootBuilder);
        LOG.info("Registering main Dispatcher servlet at: {}", rootPath);
        environment.addServlet(dispatcher, rootPath);

        // // And finally servlet for for entry access
View Full Code Here

        ServiceDispatchServlet<K,E> dispatcher = new ServiceDispatchServlet<K,E>(cluster, stuff,
                nodeStatusServlet, nodeMetricsServlet,
                storeEntryServlet, storeListServlet,
                syncListServlet, syncPullServlet);

        RequestPathBuilder rootBuilder = rootPath(stuff.getServiceConfig());
        String rootPath = servletPath(rootBuilder);
        LOG.info("Registering main Dispatcher servlet at: {}", rootPath);
        environment.addServlet(dispatcher, rootPath);

        // // And finally servlet for for entry access
View Full Code Here

        ServiceDispatchServlet<K,E> dispatcher = new ServiceDispatchServlet<K,E>(
                cluster, stuff,
                nodeStatusServlet, storeEntryServlet, null,
                syncListServlet, syncPullServlet);

        RequestPathBuilder rootBuilder = rootPath(stuff.getServiceConfig());
        String rootPath = servletPath(rootBuilder);
        LOG.info("Registering main Dispatcher servlet at: {}", rootPath);
        environment.addServlet(dispatcher, rootPath);

        // // And finally servlet for for entry access
View Full Code Here

    /**********************************************************************
     */

    protected RequestPath _rootPathFor(IpAndPort serverAddress)
    {
        RequestPathBuilder builder = _client.pathBuilder(serverAddress);
        for (String component : _rootPathSegments) {
            builder = builder.addPathSegment(component);
        }
        return builder.build();
    }
View Full Code Here

    @Override
    public ClusterStatusMessage getClusterStatus(IpAndPort ip, long timeoutMsecs)
        throws IOException
    {
        RequestPathBuilder pathBuilder = new JdkHttpClientPathBuilder(ip)
            .addPathSegments(_basePath);
        pathBuilder = _paths.appendNodeStatusPath(pathBuilder);
        return getClusterStatus(pathBuilder.toString(), timeoutMsecs);
    }
View Full Code Here

    }
   
    protected String _buildSyncPullUrl(IpAndPort endpoint)
    {
        final ServiceConfig config = _stuff.getServiceConfig();
        RequestPathBuilder pathBuilder = new JdkHttpClientPathBuilder(endpoint)
            .addPathSegments(config.servicePathRoot);
        pathBuilder = _stuff.getPathStrategy().appendSyncPullPath(pathBuilder);
        return pathBuilder.toString();
    }
View Full Code Here

         * for initial auto-registration. Although ideally maybe we should
         * pass active and passive separately... has to do, for now.
         */
        final KeyRange syncRange = local.totalRange();
        final ServiceConfig config = _stuff.getServiceConfig();
        RequestPathBuilder pathBuilder = new JdkHttpClientPathBuilder(remote.getAddress())
            .addPathSegments(config.servicePathRoot);
        pathBuilder = _stuff.getPathStrategy().appendSyncListPath(pathBuilder);
        pathBuilder = pathBuilder.addParameter(ClusterMateConstants.QUERY_PARAM_SINCE,
                String.valueOf(syncedUpTo));
        pathBuilder = pathBuilder.addParameter(ClusterMateConstants.QUERY_PARAM_KEYRANGE_START, String.valueOf(syncRange.getStart()));
        pathBuilder = pathBuilder.addParameter(ClusterMateConstants.QUERY_PARAM_KEYRANGE_LENGTH, String.valueOf(syncRange.getLength()));
        // this will include 'caller' param:
        pathBuilder = cluster.addClusterStateInfo(pathBuilder);
        pathBuilder = pathBuilder.addParameter(ClusterMateConstants.QUERY_PARAM_CLUSTER_HASH,
                String.valueOf(lastClusterHash));
        return pathBuilder.toString();
    }
View Full Code Here

   
    protected String _buildNodeStatusUpdateUrl(ClusterViewByServerUpdatable cluster, IpAndPort remote,
            String state)
    {
        final KeyRange syncRange = cluster.getLocalState().totalRange();
        RequestPathBuilder pathBuilder = new JdkHttpClientPathBuilder(remote)
            .addPathSegments(_stuff.getServiceConfig().servicePathRoot);
        pathBuilder = _stuff.getPathStrategy().appendNodeStatusPath(pathBuilder);
        pathBuilder = pathBuilder.addParameter(ClusterMateConstants.QUERY_PARAM_KEYRANGE_START, String.valueOf(syncRange.getStart()));
        pathBuilder = pathBuilder.addParameter(ClusterMateConstants.QUERY_PARAM_KEYRANGE_LENGTH, String.valueOf(syncRange.getLength()));
        pathBuilder = pathBuilder.addParameter(ClusterMateConstants.QUERY_PARAM_TIMESTAMP,
                String.valueOf(_stuff.getTimeMaster().currentTimeMillis()));
        pathBuilder = pathBuilder.addParameter(ClusterMateConstants.QUERY_PARAM_STATE, state);
        // this will include 'caller' param:
        pathBuilder = cluster.addClusterStateInfo(pathBuilder);
        return pathBuilder.toString();
    }
View Full Code Here

TOP

Related Classes of com.fasterxml.clustermate.api.RequestPathBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.