Examples of DistributedLayoutManager


Examples of org.apache.blur.manager.indexserver.DistributedLayoutManager

      return;
    }
    List<String> tableList = _clusterStatus.getTableList(false);
    HashMap<String, Map<String, String>> newLayout = new HashMap<String, Map<String, String>>();
    for (String table : tableList) {
      DistributedLayoutManager layoutManager = new DistributedLayoutManager();
      String cluster = _clusterStatus.getCluster(false, table);
      if (cluster == null) {
        continue;
      }
      List<String> shardServerList = _clusterStatus.getShardServerList(cluster);
      List<String> offlineShardServers = _clusterStatus.getOfflineShardServers(false, cluster);
      List<String> shardList = getShardList(cluster, table);
      layoutManager.setNodes(shardServerList);
      layoutManager.setNodesOffline(offlineShardServers);
      layoutManager.setShards(shardList);
      layoutManager.init();
      Map<String, String> layout = layoutManager.getLayout();
      newLayout.put(table, layout);
    }
    _shardServerLayout.set(newLayout);
  }
View Full Code Here

Examples of org.apache.blur.manager.indexserver.DistributedLayoutManager

    shards.add("s2");
    shards.add("s3");
    shards.add("s4");
    shards.add("s5");

    DistributedLayoutManager layoutManager1 = new DistributedLayoutManager();
    layoutManager1.setNodes(nodes);
    layoutManager1.setShards(shards);
    layoutManager1.init();
    Map<String, String> layout1 = layoutManager1.getLayout();

    DistributedLayoutManager layoutManager2 = new DistributedLayoutManager();
    layoutManager2.setNodes(nodes);
    layoutManager2.setShards(shards);
    layoutManager2.setNodesOffline(nodesOffline);
    layoutManager2.init();
    Map<String, String> layout2 = layoutManager2.getLayout();

    assertEquals(shards, new TreeSet<String>(layout1.keySet()));
    assertEquals(nodes, new TreeSet<String>(layout1.values()));

    assertEquals(shards, new TreeSet<String>(layout2.keySet()));
View Full Code Here

Examples of org.apache.blur.manager.indexserver.DistributedLayoutManager

  }

  @Test
  public void testLayoutManagerPerformance() {
    DistributedLayoutManager perfTest = new DistributedLayoutManager();
    perfTest.setNodes(getTestNodes());
    perfTest.setShards(getTestShards());
    perfTest.setNodesOffline(getTestOfflineNodes());
    perfTest.init();
    int testSize = 100000;
    for (int i = 0; i < testSize; i++) {
      perfTest.getLayout();
    }
    long s = System.nanoTime();
    for (int i = 0; i < testSize; i++) {
      perfTest.getLayout();
    }
    long e = System.nanoTime();
    double ms = (e - s) / 1000000.0;
    System.out.println("Total    " + ms);
    System.out.println("Per Call " + ms / testSize);
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.