public SploutState(boolean failFast, String... qNodes) { this.sploutClient = new SploutClient(qNodes); this.failFast = failFast; }
@Override public void init(Map<String, Object> context) throws Exception { client = new SploutClient(((String) context.get("qnodes")).split(",")); rowIdsPerPartition = (Map<Integer, Long>) context.get("rowIdsPerPartition"); }
@Override public void init(Map<String, Object> context) throws Exception { client = new SploutClient(((String) context.get("qnodes")).split(",")); minKey = (Integer) context.get("minKey"); maxKey = (Integer) context.get("maxKey"); paddingExp = (String) context.get("paddingExp"); tablespace = (String) context.get("tablespace"); }
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; }
@SuppressWarnings("unchecked") @Override public void init(Map<String, Object> context) throws Exception { this.context = context; client = new SploutClient(20 * 1000, ((String) context.get("qnodes")).split(",")); String query = "SELECT stn, wban FROM stations"; System.out.println("Retrieving stations list"); long statTime = System.currentTimeMillis(); QueryStatus st = client.query(tablespace, "any", query, null); if (st.getResult() == null) { throw new RuntimeException("Impossible to retrieve stations list. " + st); } stations = st.getResult(); System.out.println("Loaded " + stations.size() + " stations in " + (System.currentTimeMillis() - statTime) + " ms."); }
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); } }
SploutClient client = new SploutClient(qnode); List<String> dnodes = client.dNodeList(); final int nDNodes = dnodes.size();
String tsName = def.getName(); SploutClient client = new SploutClient(1000 * 60 * 60 * 24, qNodes.split(",")); QNodeStatus overview = client.overview();
SploutClient client = new SploutClient(qnode); QNodeStatus status = client.overview(); long previousVersion = -1;
SploutClient client = new SploutClient(qnode); List<String> dnodes = client.dNodeList(); if (dnodes == null || dnodes.size() == 0) {
public void run() throws Exception { Server server = new Server(port); WebAppContext context = new WebAppContext(); context.setContextPath("/"); context.addServlet(new ServletHolder(new DefaultServlet()), "/pagecounts/*"); context.addServlet(new ServletHolder(new PageCountsServlet(new SploutClient(qNodes.split(",")))), "/api"); context.addServlet(new ServletHolder(new PageCountsTrendingServlet()), "/trends"); ResourceCollection resources = new ResourceCollection(new String[]{Resource.newClassPathResource( "pagecounts").toString()}); context.setBaseResource(resources); server.setHandler(context); server.start(); try { while (true) { Thread.sleep(5000); } } catch (InterruptedException e) { e.printStackTrace(); server.stop(); } }