本文整理汇总了Java中nl.vu.cs.ajira.utils.Consts类的典型用法代码示例。如果您正苦于以下问题:Java Consts类的具体用法?Java Consts怎么用?Java Consts使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Consts类属于nl.vu.cs.ajira.utils包,在下文中一共展示了Consts类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printStatistics
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
public void printStatistics() {
String stats = getStatistics();
if (log.isInfoEnabled()) {
log.info(stats);
} else {
System.out.println(stats);
}
if (getState().equals(Consts.STATE_FAILED) && exception != null) {
if (log.isErrorEnabled()) {
log.error("Job failed with exception", exception);
} else {
System.err.println("Job failed with exception " + exception);
exception.printStackTrace(System.err);
}
}
}
示例2: set
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
/**
* Sets the fields of the class.
*
* @param elements
* is a array or a sequence of SimpleData objects
*/
public void set(SimpleData... elements) {
if (elements != null) {
/*
* if (log.isDebugEnabled() && signature != null && elements.length
* != signature.length) { log.debug("Changing elements of tuple to "
* + elements.length, new Throwable()); }
*/
if (elements.length > Consts.MAX_TUPLE_ELEMENTS) {
throw new Error("Too many elements in tuple");
}
signature = elements;
nElements = elements.length;
} else {
nElements = 0;
}
}
示例3: TupleSender
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
/**
* Custom constructor.
*
* @param context
* Current context
*/
public TupleSender(Context context) {
this.context = context;
this.buckets = context.getBuckets();
this.compressing = context.getConfiguration().getBoolean(Consts.SEND_TUPLES_COMPRESSED, true);
ThreadPool.createNew(new Runnable() {
@Override
public void run() {
checkTuples();
}
}, "TupleSenderChecker");
for (int i = 0; i < Consts.MAX_TUPLE_SENDERS; i++) {
ThreadPool.createNew(new Runnable() {
@Override
public void run() {
sendTuples();
}
}, "TupleSender " + i);
}
}
示例4: startReasoner
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
public void startReasoner(String[] args) throws Exception {
Ajira arch = new Ajira(true);
Configuration conf = arch.getConfiguration();
parseArgs(args, conf);
conf.set("indexFileImpl", PlainTripleFile.class.getName());
InputLayer.setDefaultInputLayerClass(RDFStorage.class, conf);
if (useGAT) {
log.debug("Going to use JavaGAT...");
GATContext context = new GATContext();
Preferences prefs = new Preferences();
prefs.put("file.adaptor.name", "local,commandlinessh");
prefs.put("fileinputstream.adaptor.name", "local,copying");
context.addPreferences(prefs);
GAT.setDefaultGATContext(context);
conf.set(RDFStorage.FILES_INTERFACE,
JavaGATFilesInterface.class.getName());
}
conf.setBoolean(Consts.SEND_TUPLES_COMPRESSED, false); // Probably not
// worth the
// effort
arch.startup();
}
示例5: main
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
public static void main(String[] args) {
AjiraEval runner = new AjiraEval();
Ajira ajira = new Ajira();
ajira.getConfiguration().set(InputLayer.INPUT_LAYER_CLASS, RandomGeneratorInputLayer.class.getName());
ajira.getConfiguration().setInt(Consts.N_PROC_THREADS, numThreads);
try {
ajira.startup();
} catch (Exception e) {
e.printStackTrace();
}
if (runSingleThreadExamples) runner.runSingleThreadExamples(ajira);
if (runMultiThreadExamples) runner.runMultiThreadExamples(ajira);
ajira.shutdown();
}
示例6: killSubmission
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
public void killSubmission(int submissionId, Throwable e) {
Submission sub = submissions.get(submissionId);
if (sub == null) {
return;
}
synchronized (sub) {
if (sub.getState() == Consts.STATE_FINISHED) {
return;
}
sub.setFinished(Consts.STATE_FAILED);
sub.setException(e);
sub.notifyAll();
}
}
示例7: getStatistics
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
public void getStatistics(Submission submission) {
if (net.getNumberNodes() > 1) {
// TODO: to replace with a faster method to retrieve the statistics
try {
Thread.sleep(Consts.STATISTICS_COLLECTION_INTERVAL);
} catch (InterruptedException e) {
// ignore
}
}
submission.counters = stats.removeCountersSubmission(submission
.getSubmissionId());
}
示例8: Submission
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
public Submission(int submissionId, int assignedOutputBucket) {
startupTime = System.currentTimeMillis();
state = Consts.STATE_OPEN;
finalStatsReceived = 0;
rootChainsReceived = -1;
assignedBucket = assignedOutputBucket;
this.submissionId = submissionId;
mainRootReceived = false;
}
示例9: getIdDatatype
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
@Override
/**
* Returns the id of the class.
*/
public int getIdDatatype() {
return Consts.DATATYPE_TSTRINGARRAY;
}
示例10: getIdDatatype
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
@Override
/**
* Returns the id of data class type.
*/
public int getIdDatatype() {
return Consts.DATATYPE_TINT;
}
示例11: getIdDatatype
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
@Override
/**
* Returns the id of the class.
*/
public int getIdDatatype() {
return Consts.DATATYPE_TBOOLEANARRAY;
}
示例12: getIdDatatype
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
@Override
/**
* returns the id of data class type.
*/
public int getIdDatatype() {
return Consts.DATATYPE_TSTRING;
}
示例13: getIdDatatype
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
@Override
/**
* Returns the id of the class.
*/
public int getIdDatatype() {
return Consts.DATATYPE_TINTARRAY;
}
示例14: getIdDatatype
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
@Override
/**
* Returns the id of data class type.
*/
public int getIdDatatype() {
return Consts.DATATYPE_TLONG;
}
示例15: getIdDatatype
import nl.vu.cs.ajira.utils.Consts; //导入依赖的package包/类
@Override
/**
* Returns the id of the class.
*/
public int getIdDatatype() {
return Consts.DATATYPE_TLONGARRAY;
}