/** * Set the number of input split threads * * @param numInputSplitsThreads Number of input split threads to use */ public void setNumInputSplitsThreads(int numInputSplitsThreads) { NUM_INPUT_THREADS.set(this, numInputSplitsThreads); }
/** * Set the maximum timeout (in milliseconds) for waiting for all tasks * to complete after the job is done. * * @param ms Milliseconds to set */ public void setWaitTaskDoneTimeoutMs(int ms) { WAIT_TASK_DONE_TIMEOUT_MS.set(this, ms); }
/** * Set the number of milliseconds to wait for an event before continuing on * * @param eventWaitMsecs Number of milliseconds to wait for an event before * continuing on */ public void setEventWaitMsecs(int eventWaitMsecs) { EVENT_WAIT_MSECS.set(this, eventWaitMsecs); }
/** * Set the number of threads to use for writing output in the end of the * application. Will be used only if {#vertexOutputFormatThreadSafe} is true. * * @param numOutputThreads Number of output threads */ public void setNumOutputThreads(int numOutputThreads) { NUM_OUTPUT_THREADS.set(this, numOutputThreads); }
/** * Set heap size for Giraph tasks in our job run, assuming * the job will run on the "pure YARN" profile. * * @param heapMb the heap size for all tasks */ public void setYarnTaskHeapMb(int heapMb) { GIRAPH_YARN_TASK_HEAP_MB.set(this, heapMb); }
/** * Set the number of compute threads * * @param numComputeThreads Number of compute threads to use */ public void setNumComputeThreads(int numComputeThreads) { NUM_COMPUTE_THREADS.set(this, numComputeThreads); }
/** * Set the max task attempts * * @param maxTaskAttempts Max task attempts to use */ public void setMaxTaskAttempts(int maxTaskAttempts) { MAX_TASK_ATTEMPTS.set(this, maxTaskAttempts); }
/** * Set the checkpoint frequeuncy of how many supersteps to wait before * checkpointing * * @param checkpointFrequency How often to checkpoint (0 means never) */ public void setCheckpointFrequency(int checkpointFrequency) { CHECKPOINT_FREQUENCY.set(this, checkpointFrequency); }
/** * Set the maximum milliseconds to wait before giving up trying to get the * minimum number of workers before a superstep. * * @param maxMasterSuperstepWaitMsecs Maximum milliseconds to wait before * giving up trying to get the minimum * number of workers before a superstep */ public void setMaxMasterSuperstepWaitMsecs(int maxMasterSuperstepWaitMsecs) { MAX_MASTER_SUPERSTEP_WAIT_MSECS.set(this, maxMasterSuperstepWaitMsecs); }
/** * Set the maximum number of supersteps of this application. After this * many supersteps are executed, the application will shutdown. * * @param maxNumberOfSupersteps Maximum number of supersteps */ public void setMaxNumberOfSupersteps(int maxNumberOfSupersteps) { MAX_NUMBER_OF_SUPERSTEPS.set(this, maxNumberOfSupersteps); }
/** * Create and start the Thrift server. * * @param conf Giraph conf to set the host and ports for. * @param services Services to start */ public ClientThriftServer(GiraphConfiguration conf, List<?> services) { checkNotNull(conf, "conf is null"); checkNotNull(services, "services is null"); ThriftServiceProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), new ArrayList<ThriftEventHandler>(), services); clientThriftServer = new ThriftServer(processor, new ThriftServerConfig()); clientThriftServer.start(); try { CLIENT_THRIFT_SERVER_HOST.set( conf, conf.getLocalHostname()); } catch (UnknownHostException e) { throw new IllegalStateException("Unable to get host information", e); } CLIENT_THRIFT_SERVER_PORT.set(conf, clientThriftServer.getPort()); }
GiraphConstants.SUPERSTEP_COUNT.set(conf, pieceCount.getCount() + 1);
private void addPrivateConfiguration(GiraphConfiguration configuration) { // Set currently fixed classes. TODO: Allow configuration at some point perhaps configuration.setComputationClass(io.arabesque.computation.ExecutionEngine.class); configuration.setMasterComputeClass(io.arabesque.computation.MasterExecutionEngine.class); configuration.setVertexInputFormatClass(ArabesqueInputFormat.class); // Calculate partition count based on # of workers and # of threads if no count was provided if (GiraphConstants.USER_PARTITION_COUNT.get(configuration) == -1) { int numWorkers = configuration.getMinWorkers(); int numComputeThreads = configuration.getNumComputeThreads(); GiraphConstants.USER_PARTITION_COUNT.set(configuration, numWorkers * numComputeThreads); } // Set our default worker context class instead of Giraph's default if (GiraphConstants.WORKER_CONTEXT_CLASS.get(configuration).equals(DefaultWorkerContext.class)) { configuration.setWorkerContextClass(WorkerContext.class); } }
GiraphConstants.SPLIT_MASTER_WORKER.set(conf, false); GiraphConstants.LOCAL_TEST_MODE.set(conf, true); GiraphConstants.ZOOKEEPER_SERVER_PORT.set(conf, 0);