Examples of UriPropertiesJsonSerializer


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

    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);
    PropertyEventBus<UriProperties> uriBus = new PropertyEventBusImpl<UriProperties>(executorService);
View Full Code Here

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

              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(),
                                                         new UriPropertiesMerger(),
                                                         ZKFSUtil.uriPath(BASE_PATH));
      Map<URI, Map<Integer, PartitionData>> uriData = new HashMap<URI, Map<Integer, PartitionData>>();
      Map<Integer, PartitionData> partitionData = new HashMap<Integer, PartitionData>(1);
      partitionData.put(DefaultPartitionAccessor.DEFAULT_PARTITION_ID, new PartitionData(1.0d));
View Full Code Here

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

      ClusterProperties clusterProps = new ClusterProperties("someCluster");
      clusterStore.put(TEST_CLUSTER_NAME, clusterProps);

      ZKConnection serverConn = new ZKConnection("localhost:" + PORT, 30000);
      serverConn.start();
      ZooKeeperEphemeralStore<UriProperties> uriStore = new ZooKeeperEphemeralStore<UriProperties>(serverConn, new UriPropertiesJsonSerializer(), new UriPropertiesMerger(), ZKFSUtil.uriPath(BASE_PATH));
      callback = new FutureCallback<None>();
      uriStore.start(callback);
      callback.get(30, TimeUnit.SECONDS);

      ZooKeeperServer server = new ZooKeeperServer(uriStore);
View Full Code Here

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

    ZKConnection zkClient = new ZKConnection("localhost:" + PORT, 5000);
    zkClient.start();

    ZooKeeperEphemeralStore<UriProperties> store =
        new ZooKeeperEphemeralStore<UriProperties>(zkClient,
                                                   new UriPropertiesJsonSerializer(),
                                                   new UriPropertiesMerger(),
                                                   "/echo/lb/uris");
    FutureCallback<None> callback = new FutureCallback<None>();
    store.start(callback);
    callback.get();
View Full Code Here

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

    final ZKConnection zkClient = ZKTestUtil.getConnection(zookeeperHost+":"+zookeeperPort, _timeout);

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

    final CountDownLatch wait = new CountDownLatch(1);
View Full Code Here

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

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

    // chains
    PropertyEventThread thread = new PropertyEventThread("echo client event thread");
    ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory(
                        "echo client event thread"));
View Full Code Here

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

                                                              scstoreString,
                                                              new ServicePropertiesJsonSerializer());
    ZooKeeperEphemeralStore<UriProperties> zkUriRegistry =
        (ZooKeeperEphemeralStore<UriProperties>) getEphemeralStore(zkclient,
                                                                   uristoreString,
                                                                   new UriPropertiesJsonSerializer(),
                                                                   new UriPropertiesMerger());

    ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1, new NamedThreadFactory("D2 PropertyEventExecutor"));

    PropertyEventBus<ServiceProperties> serviceBus =
View Full Code Here

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

                                                              scstoreString,
                                                              new ServicePropertiesJsonSerializer());
    ZooKeeperEphemeralStore<UriProperties> zkUriRegistry =
        (ZooKeeperEphemeralStore<UriProperties>) getEphemeralStore(_zkclient,
                                                                   uristoreString,
                                                                   new UriPropertiesJsonSerializer(),
                                                                   new UriPropertiesMerger());

    String clusterName = zkServiceRegistry.get(serviceName).getClusterName();
    UriProperties uripros = zkUriRegistry.get(clusterName);
    uriprops.add( uripros);
View Full Code Here

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

                                                              scstoreString,
                                                              new ServicePropertiesJsonSerializer());
    ZooKeeperEphemeralStore<UriProperties> zkUriRegistry =
        (ZooKeeperEphemeralStore<UriProperties>) getEphemeralStore(_zkclient,
                                                                   uristoreString,
                                                                   new UriPropertiesJsonSerializer(),
                                                                   new UriPropertiesMerger());

    List<String> currentservices = zkServiceRegistry.ls();

    for (String service : currentservices)
View Full Code Here

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

                                                              clstoreString,
                                                              new ClusterPropertiesJsonSerializer());
      zkUriRegistry =
        (ZooKeeperEphemeralStore<UriProperties>) getEphemeralStore(zkclient,
                                                                   uristoreString,
                                                                   new UriPropertiesJsonSerializer(),
                                                                   new UriPropertiesMerger());



      if (serviceGroup != null)
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.