Package com.linkedin.d2.balancer.properties

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


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

      ZooKeeperPermanentStore<ServiceProperties> store =
              new ZooKeeperPermanentStore<ServiceProperties>(conn, new ServicePropertiesJsonSerializer(), ZKFSUtil.servicePath(BASE_PATH));
      callback = new FutureCallback<None>();
      store.start(callback);
      callback.get(30, TimeUnit.SECONDS);

      ServiceProperties props = new ServiceProperties(TEST_SERVICE_NAME, "someCluster", "/somePath", "someStrategy");
View Full Code Here


      ZKConnection conn = balancer.zkConnection();

      ZooKeeperPermanentStore<ServiceProperties> serviceStore =
              new ZooKeeperPermanentStore<ServiceProperties>(conn,
                                                             new ServicePropertiesJsonSerializer(),
                                                             ZKFSUtil.servicePath(BASE_PATH));

      ServiceProperties props = new ServiceProperties(TEST_SERVICE_NAME, TEST_CLUSTER_NAME, "/test", "degrader",
                                                      Collections.<String>emptyList(),
                                                      Collections.<String, Object> emptyMap(),
View Full Code Here

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

      ZooKeeperPermanentStore<ServiceProperties> store =
              new ZooKeeperPermanentStore<ServiceProperties>(conn, new ServicePropertiesJsonSerializer(), ZKFSUtil.servicePath(BASE_PATH));
      callback = new FutureCallback<None>();
      store.start(callback);
      callback.get(30, TimeUnit.SECONDS);

View Full Code Here

                                                       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());

    FileStore<UriProperties> fsUriStore =
        new FileStore<UriProperties>(testDirectory + File.separator + "uri",
                                     ".ini",
                                     new UriPropertiesJsonSerializer());
View Full Code Here

    ZKConnection client = new ZKConnection(_zookeeperHost+":"+_zookeeperPort, 30000);

    PropertyStore<ServiceProperties> store =
        new ZooKeeperPermanentStore<ServiceProperties>(client,
                                                       new ServicePropertiesJsonSerializer(),
                                                       _basePath+"/services");

    store.put(serviceProperties.getServiceName(), serviceProperties);
    client.getZooKeeper().close();
  }
View Full Code Here

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

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

    ZooKeeperPermanentStore<ServiceProperties> zkServiceRegistry =
        (ZooKeeperPermanentStore<ServiceProperties>) getStore(_zkclient,
                                                              scstoreString,
                                                              new ServicePropertiesJsonSerializer());
    ZooKeeperEphemeralStore<UriProperties> zkUriRegistry =
        (ZooKeeperEphemeralStore<UriProperties>) getEphemeralStore(_zkclient,
                                                                   uristoreString,
                                                                   new UriPropertiesJsonSerializer(),
                                                                   new UriPropertiesMerger());
View Full Code Here

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

    ZooKeeperPermanentStore<ServiceProperties> zkServiceRegistry =
        (ZooKeeperPermanentStore<ServiceProperties>) getStore(_zkclient,
                                                              scstoreString,
                                                              new ServicePropertiesJsonSerializer());
    ZooKeeperEphemeralStore<UriProperties> zkUriRegistry =
        (ZooKeeperEphemeralStore<UriProperties>) getEphemeralStore(_zkclient,
                                                                   uristoreString,
                                                                   new UriPropertiesJsonSerializer(),
                                                                   new UriPropertiesMerger());
View Full Code Here

    String scstoreString = zkserver + ZKFSUtil.servicePath(d2path);

    zkServiceRegistry =
        (ZooKeeperPermanentStore<ServiceProperties>) getStore(zkclient,
                                                              scstoreString,
                                                              new ServicePropertiesJsonSerializer());

    return zkServiceRegistry.get(service).getClusterName().equals(cluster);

  }
View Full Code Here

      if (serviceGroup != null)
      {
        String scstoreString = zkserver + ZKFSUtil.servicePath(d2path, serviceGroup);
        zkServiceRegistry = (ZooKeeperPermanentStore<ServiceProperties>) getStore(zkclient,
                                                                scstoreString,
                                                                new ServicePropertiesJsonSerializer());
      }
      else
      {
        String scstoreString = zkserver + ZKFSUtil.servicePath(d2path);
        zkServiceRegistry = (ZooKeeperPermanentStore<ServiceProperties>) getStore(zkclient,
                                                                scstoreString,
                                                                new ServicePropertiesJsonSerializer());
      }

      sb.append(printStore(zkClusterRegistry, zkUriRegistry, cluster));

      if (zkServiceRegistry.get(service).getClusterName().equals(cluster))
View Full Code Here

TOP

Related Classes of com.linkedin.d2.balancer.properties.ServicePropertiesJsonSerializer

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.