Examples of DBChunk


Examples of edu.yale.cs.hadoopdb.connector.DBChunk

    if(chunkHostMap == null) {
      throw new RuntimeException("Relation '" + relation + "' is not defined in the catalog.");
    }
    Set<Node> usedNodes = new HashSet<Node>();
    for (String chunk_id : chunkHostMap.keySet()) {
      DBChunk chunk = new DBChunk(chunk_id);
      if (replication) {
        for (Node node : chunkHostMap.get(chunk_id)) {
          chunk.addHost(new DBChunkHost(node.getLocation(),
              xmlConfig.getPartitionForNodeRelation(node,
                  relation, chunk_id).getUrl(), node
                  .getUsername(), node.getPassword(), node
                  .getDriver()));
        }
      } else {
        for (Node node : chunkHostMap.get(chunk_id)) {
          if (usedNodes.contains(node))
            ;
          else {
            usedNodes.add(node);
            chunk.addHost(new DBChunkHost(node.getLocation(),
                xmlConfig.getPartitionForNodeRelation(node,
                    relation, chunk_id).getUrl(), node
                    .getUsername(), node.getPassword(),
                node.getDriver()));
            break;

          }
        }
        if (chunk.getHosts().isEmpty()) {
          Node node = chunkHostMap.get(chunk_id).get(0);
          chunk.addHost(new DBChunkHost(node.getLocation(),
              xmlConfig.getPartitionForNodeRelation(node,
                  relation, chunk_id).getUrl(), node
                  .getUsername(), node.getPassword(), node
                  .getDriver()));
        }
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.