protected PartitionMap retrievePartitionMapfromQNode(String tablespace) throws Exception { log.info("Retrieving partition map for tablespace[" + tablespace + "] from QNode[" + qnodeURL +"] for being reused at indexation. "); SploutClient client = new SploutClient(qnodeURL.split(",")); Tablespace tb = client.tablespace(tablespace); if (tb == null) { throw new Exception("Partition map for tablespace [" + tablespace + "] not found at QNode[" + qnodeURL +"]."); } PartitionMap pmap = tb.getPartitionMap(); log.info("Successfully retrieved partition map for tablespace[" + tablespace + "] from QNode[" + qnodeURL +"]."); return pmap; }
public void start() throws InterruptedException, IOException { Map<String, Object> context = new HashMap<String, Object>(); context.put("qnodes", qNodes); Map<Integer, Long> rowIdsPerPartition = new HashMap<Integer, Long>(); context.put("rowIdsPerPartition", rowIdsPerPartition); // First get Tablespace metadata - nPartitions SploutClient client = new SploutClient(((String) context.get("qnodes")).split(",")); Tablespace tablespace = client.tablespace(TABLESPACE); int nPartitions = tablespace.getPartitionMap().getPartitionEntries().size(); // Then gather number of registers for each partition for (int partition = 0; partition < nPartitions; partition++) { String query = "SELECT MAX(rowid) FROM pagecounts;"; Map<String, Object> obj = (Map<String, Object>) client .query(TABLESPACE, null, query, partition + "").getResult().get(0); rowIdsPerPartition.put(partition, Long.parseLong(obj.get("MAX(rowid)").toString())); } SploutBenchmark benchmark = new SploutBenchmark(); for (int i = 0; i < nIterations; i++) { benchmark.stressTest(nThreads, nQueries, PageCountsStressThreadImpl.class, context); benchmark.printStats(System.out); } }
impactedKeys.addAll(tablespace.getPartitionMap().findPartitions(null, null)); // all partitions are hit impactedKeys.addAll(tablespace.getPartitionMap().findPartitions(keyMins.get(i), keyMaxs.get(i)));
return new ErrorQueryStatus("Unknown tablespace version:(" + version + ") tablespace:(" + tablespaceName + ")"); PartitionMap partitionMap = tablespace.getPartitionMap();
int nPartitions = tablespace.getPartitionMap().getPartitionEntries().size();
new TablespaceVersion(req.getTablespace(), req.getVersion())); if (t != null && t.getReplicationMap() != null && t.getPartitionMap() != null && t.getPartitionMap().getPartitionEntries() != null && t.getReplicationMap().getReplicationEntries() != null && t.getReplicationMap().getReplicationEntries().size() > 0) { if (t.getPartitionMap().getPartitionEntries().size() == t.getReplicationMap() .getReplicationEntries().size()) { log.info("Ok, TablespaceVersion [" + req.getTablespace() + ", " + req.getVersion()
tablespace.getPartitionMap().getPartitionEntries().remove(pEntry); partitionMap.addAll(currentTablespace.getPartitionMap().getPartitionEntries()); replicationMap.addAll(currentTablespace.getReplicationMap().getReplicationEntries()); deployDate = currentTablespace.getCreationDate();