Examples of ClusterPropertiesJsonSerializer


Examples of com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer

    _zkConnection.start();

    try
    {
      _log.info("Cluster configuration:\n" + clusters);
      writeConfig(ZKFSUtil.clusterPath(_basePath), new ClusterPropertiesJsonSerializer(),
                  new ClusterPropertiesJsonSerializer(), clusters, _clusterDefaults);
      _log.info("Wrote cluster configuration");

      _log.info("Service configuration:\n" + services);
      writeConfig(ZKFSUtil.servicePath(_basePath), new ServicePropertiesJsonSerializer(),
                  new ServicePropertiesJsonSerializer(), services, _serviceDefaults);
View Full Code Here

Examples of com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer

  @Override
  public TogglingLoadBalancer createLoadBalancer(ZKConnection zkConnection, ScheduledExecutorService executorService)
  {
    _log.info("Using d2ServicePath: " + _d2ServicePath);
    ZooKeeperPermanentStore<ClusterProperties> zkClusterRegistry = createPermanentStore(
            zkConnection, ZKFSUtil.clusterPath(_baseZKPath), new ClusterPropertiesJsonSerializer());
    ZooKeeperPermanentStore<ServiceProperties> zkServiceRegistry = createPermanentStore(
            zkConnection, ZKFSUtil.servicePath(_baseZKPath, _d2ServicePath), new ServicePropertiesJsonSerializer());
    ZooKeeperEphemeralStore<UriProperties> zkUriRegistry =  createEphemeralStore(
            zkConnection, ZKFSUtil.uriPath(_baseZKPath), new UriPropertiesJsonSerializer(), new UriPropertiesMerger());

    FileStore<ClusterProperties> fsClusterStore = createFileStore("clusters", new ClusterPropertiesJsonSerializer());
    FileStore<ServiceProperties> fsServiceStore = createFileStore(_d2ServicePath, new ServicePropertiesJsonSerializer());
    FileStore<UriProperties> fsUriStore = createFileStore("uris", new UriPropertiesJsonSerializer());

    PropertyEventBus<ClusterProperties> clusterBus = new PropertyEventBusImpl<ClusterProperties>(executorService);
    PropertyEventBus<ServiceProperties> serviceBus = new PropertyEventBusImpl<ServiceProperties>(executorService);
View Full Code Here

Examples of com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer

      ZKConnection conn = new ZKConnection("localhost:" + PORT, 30000);
      conn.start();

      ZooKeeperPermanentStore<ClusterProperties> store =
              new ZooKeeperPermanentStore<ClusterProperties>(conn, new ClusterPropertiesJsonSerializer(),
                                                             ZKFSUtil.clusterPath(BASE_PATH));
      callback = new FutureCallback<None>();
      store.start(callback);
      callback.get(30, TimeUnit.SECONDS);
View Full Code Here

Examples of com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer

                                                      null);
      serviceStore.put(TEST_SERVICE_NAME, props);

      ClusterProperties clusterProperties = new ClusterProperties(TEST_CLUSTER_NAME);
      ZooKeeperPermanentStore<ClusterProperties> clusterStore =
              new ZooKeeperPermanentStore<ClusterProperties>(conn, new ClusterPropertiesJsonSerializer(), ZKFSUtil.clusterPath(BASE_PATH));
      clusterStore.put(TEST_CLUSTER_NAME, clusterProperties);

      ZooKeeperEphemeralStore<UriProperties> uriStore =
              new ZooKeeperEphemeralStore<UriProperties>(conn,
                                                         new UriPropertiesJsonSerializer(),
View Full Code Here

Examples of com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer

                                                      Arrays.asList("http"),
                                                      null);
      store.put(TEST_SERVICE_NAME, props);

      ZooKeeperPermanentStore<ClusterProperties> clusterStore =
              new ZooKeeperPermanentStore<ClusterProperties>(conn, new ClusterPropertiesJsonSerializer(), ZKFSUtil.clusterPath(BASE_PATH));
      callback = new FutureCallback<None>();
      clusterStore.start(callback);
      callback.get(30, TimeUnit.SECONDS);

      ClusterProperties clusterProps = new ClusterProperties("someCluster");
View Full Code Here

Examples of com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer

    ZKConnection zkClient = new ZKConnection(hostPort, 10000);

    zkClusterRegistry =
        new ZooKeeperPermanentStore<ClusterProperties>(zkClient,
                                                       new ClusterPropertiesJsonSerializer(),
                                                       _basePath+"/clusters");

    zkServiceRegistry =
        new ZooKeeperPermanentStore<ServiceProperties>(zkClient,
                                                       new ServicePropertiesJsonSerializer(),
                                                       _basePath+"/services");

    zkUriRegistry =
        new ZooKeeperEphemeralStore<UriProperties>(zkClient,
                                                   new UriPropertiesJsonSerializer(),
                                                   new UriPropertiesMerger(),
                                                   _basePath+"/uris");

    // fs stores
    File testDirectory =
        LoadBalancerUtil.createTempDirectory("lb-degrader-witih-file-store-large");

    testDirectory.deleteOnExit();

    new File(testDirectory + File.separator + "cluster").mkdir();
    new File(testDirectory + File.separator + "service").mkdir();
    new File(testDirectory + File.separator + "uri").mkdir();

    FileStore<ClusterProperties> fsClusterStore =
        new FileStore<ClusterProperties>(testDirectory + File.separator + "cluster",
                                         ".ini",
                                         new ClusterPropertiesJsonSerializer());

    FileStore<ServiceProperties> fsServiceStore =
        new FileStore<ServiceProperties>(testDirectory + File.separator + "service",
                                         ".ini",
                                         new ServicePropertiesJsonSerializer());
View Full Code Here

Examples of com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer

    System.err.println("put: " + clusterProperties);

    ZKConnection client = new ZKConnection(_zookeeperHost+":"+_zookeeperPort, 30000);
    PropertyStore<ClusterProperties> store =
        new ZooKeeperPermanentStore<ClusterProperties>(client,
                                                       new ClusterPropertiesJsonSerializer(),
                                                       _basePath+"/clusters");

    store.put(clusterProperties.getClusterName(), clusterProperties);
    client.getZooKeeper().close();
  }
View Full Code Here

Examples of com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer

    String uristoreString = zkserver + ZKFSUtil.uriPath(d2path);

    ZooKeeperPermanentStore<ClusterProperties> zkClusterRegistry =
        (ZooKeeperPermanentStore<ClusterProperties>) getStore(zkclient,
                                                              clstoreString,
                                                              new ClusterPropertiesJsonSerializer());
    ZooKeeperPermanentStore<ServiceProperties> zkServiceRegistry =
        (ZooKeeperPermanentStore<ServiceProperties>) getStore(zkclient,
                                                              scstoreString,
                                                              new ServicePropertiesJsonSerializer());
    ZooKeeperEphemeralStore<UriProperties> zkUriRegistry =
View Full Code Here

Examples of com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer

      String uristoreString = zkserver + ZKFSUtil.uriPath(d2path);

      zkClusterRegistry =
        (ZooKeeperPermanentStore<ClusterProperties>) getStore(zkclient,
                                                              clstoreString,
                                                              new ClusterPropertiesJsonSerializer());
      zkUriRegistry =
        (ZooKeeperEphemeralStore<UriProperties>) getEphemeralStore(zkclient,
                                                                   uristoreString,
                                                                   new UriPropertiesJsonSerializer(),
                                                                   new UriPropertiesMerger());
View Full Code Here

Examples of com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer

    String uristoreString = zkserver + ZKFSUtil.uriPath(d2path);

    ZooKeeperPermanentStore<ClusterProperties> zkClusterRegistry =
        (ZooKeeperPermanentStore<ClusterProperties>) getStore(zkclient,
                                                              clstoreString,
                                                              new ClusterPropertiesJsonSerializer());
    ZooKeeperEphemeralStore<UriProperties> zkUriRegistry =
        (ZooKeeperEphemeralStore<UriProperties>) getEphemeralStore(zkclient,
                                                                   uristoreString,
                                                                   new UriPropertiesJsonSerializer(),
                                                                   new UriPropertiesMerger());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.