本文整理汇总了Java中org.apache.jena.atlas.logging.Log.warn方法的典型用法代码示例。如果您正苦于以下问题:Java Log.warn方法的具体用法?Java Log.warn怎么用?Java Log.warn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jena.atlas.logging.Log
的用法示例。
在下文中一共展示了Log.warn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: register
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
@Override
final
public RegToken register(Id clientId) {
// Aligned to DeltaLinkHTTP behaviour for testing purpoes.
// Allow multiple registrations.
// It has the effect of swapping the valid RegToken, hence link a client restart
// XXX Rework later.
if ( false && isRegistered() ) {
if ( this.clientId.equals(clientId) ) {
Log.warn(this, "Already registered: "+clientId);
return regToken;
} else {
Log.error(this, "Already registered under a different clientId: "+clientId);
throw new DeltaBadRequestException("Already registered under a different clientId");
}
}
this.clientId = clientId;
regToken = linkMgr.register(clientId);
return regToken;
}
示例2: fromJson
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
public static DataSourceDescription fromJson(JsonObject obj) {
String idStr = JSONX.getStrOrNull(obj, F_ID);
if ( idStr == null )
throw new DeltaException("Missing \"id:\" in DataSourceDescription JSON");
String name = JSONX.getStrOrNull(obj, F_NAME);
if ( name == null ) {
@SuppressWarnings("deprecation")
String n = JSONX.getStrOrNull(obj, F_BASE);
// Compatibility.
Log.warn(DataSourceDescription.class, "Deprecated: Use of field name \"base\" - change to \"name\"");
name = n;
}
if ( name == null )
throw new DeltaException("Missing \"name:\" in DataSourceDescription JSON");
String uri = JSONX.getStrOrNull(obj, F_URI);
return new DataSourceDescription(Id.fromString(idStr), name, uri);
}
示例3: UNUSED_CURRENTLY_forkUpdateFetcher
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
private static void UNUSED_CURRENTLY_forkUpdateFetcher(String source, DatasetGraph dsg) {
if ( true ) {
Log.warn(DeltaAssembler.class, "forkUpdateFetcher not set up");
if ( true ) return;
throw new NotImplemented("NEED THE STATE AREA; NEED THE DATASOURCE ID; NEED THE CLIENT ID");
}
DeltaLink dc = DeltaLinkHTTP.connect(source) ;
DeltaConnection client = null;
Runnable r = ()->{
try { client.sync(); }
catch (Exception ex) {
Delta.DELTA_LOG.warn("Failed to sync with the change server: "+ex.getMessage()) ;
// // Delay this task ; extra 3s + the time interval of 2s.
// Dones not work as expected.
// Lib.sleep(5*1000);
}
} ;
ScheduledExecutorService executor = Executors.newScheduledThreadPool(1) ;
executor.scheduleWithFixedDelay(r, 2, 2, TimeUnit.SECONDS) ;
}
示例4: execEvaluated
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
@Override
public QueryIterator execEvaluated(Binding binding, Node subject, Node predicate, Node object, ExecutionContext execCxt) {
Table table = getTable(predicate) ;
if ( table == null ) {
Log.warn(this, "No table for "+SSE.str(predicate));
return IterLib.noResults(execCxt) ;
}
if ( subject.isVariable() ) {
if ( object.isVariable() )
return execVarVar(binding, table, subject, object, execCxt) ;
else
return execVarTerm(binding, table, subject, object, execCxt) ;
} else {
if ( object.isVariable() )
return execTermVar(binding, table, subject, object, execCxt) ;
else
return execTermTerm(binding, table, subject, object, execCxt) ;
}
}
示例5: transform
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
public Op transform(RemediatorQuery remediatorQuery) {
if (OpBGP.isBGP(remediatorQuery.getSimplifiedOperations())) {
{
DatasetQueryVarLinksets linksetOpServices;
originalClause = BGPToClause((OpBGP) remediatorQuery.getSimplifiedOperations());
rewriteBGP(originalClause);
voidModel.InferVariableClasses(globalQueryVars);
globalQueryVars.locateDatasetClauses(datasets);
linksetOpServices=linksets.createLinksetQueryClauses(globalQueryVars);
if (optimize && ! voidModel.getPartitionStatisticsAvailable()){
Log.warn(this, "Statistics not queried nor read so optimization of query plan not avaiable. Heuristic will be used instead");
this.optimize=false;
}
queryPlan = new QueryPlan(globalQueryVars, optimize);
//datasets.createDatasetQueryClauses(remediatorQuery, globalQueryVars);
return createOpSequence(linksetOpServices);
}
} else {
Log.warn(this, "Can only transform BGPs " + remediatorQuery.getSimplifiedOperations().toString());
return null;
}
}
示例6: mergeToBGP
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
private Op mergeToBGP(Op left, Op right) {
BasicPattern bgp = new BasicPattern();
if (OpBGP.isBGP(left)) {
bgp.addAll(((OpBGP) left).getPattern());
} else {
if (!(left instanceof OpTable))
Log.warn(this, "mergeToBGP left not valid BGP " + left.toString());
}
if (OpBGP.isBGP(right)) {
bgp.addAll(((OpBGP) right).getPattern());
;
} else {
if (!(right instanceof OpTable))
Log.warn(this, "mergeToBGP right not valid BGP"+ right.toString());
}
return new OpBGP(bgp);
}
示例7: addToBinding
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
public static void addToBinding(BindingMap binding, QuerySolution qSolution) {
if ( qSolution == null )
return ;
for ( Iterator<String> iter = qSolution.varNames() ; iter.hasNext() ; ) {
String n = iter.next() ;
RDFNode x = qSolution.get(n) ;
if ( Var.isBlankNodeVarName(n) )
continue ;
try {
binding.add(Var.alloc(n), x.asNode()) ;
}
catch (ARQInternalErrorException ex) {
// bad binding attempt.
Log.warn(BindingUtils.class, "Attempt to bind " + n + " when already bound") ;
}
}
}
示例8: merge
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
/** Merge two bindings, assuming they are compatible. */
public static Binding merge(Binding bind1, Binding bind2) {
//Create binding from LHS
BindingBuilder builder = new BindingBuilder(bind1, bind2.size()) ;
Iterator<Var> vIter = bind2.vars() ;
// Add any variables from the RHS
for ( ; vIter.hasNext() ; ) {
Var v = vIter.next() ;
if ( ! builder.contains(v) )
builder.add(v, bind2.get(v)) ;
else {
// Checking!
Node n1 = bind1.get(v) ;
Node n2 = bind2.get(v) ;
if ( ! n1.equals(n2) )
Log.warn(BindingUtils.class, "merge: Mismatch : "+n1+" != "+n2);
}
}
return builder.build() ;
}
示例9: specialcase
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
private QueryIterator specialcase(Node gn, Op subOp) {
// This is a placeholder for code to specially handle explicitly named
// default graph and union graph.
if (Quad.isDefaultGraph(gn)) {
// Get factory.
ExecutionContext cxt2 = new ExecutionContext(execCxt, execCxt.getDataset().getDefaultGraph()) ;
OpEvaluator sub = new OpEvaluator(cxt2) ;
// Or push-pop ExecutionContext
return sub.exec(subOp) ;
}
if ( Quad.isUnionGraph(gn) )
Log.warn(this, "Not implemented yet: union default graph in general OpExecutor") ;
// Bad news -- if ( Lib.equals(gn, Quad.tripleInQuad) ) {}
return null ;
}
示例10: put
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
/** Insert a class that is the iterator function implementation
*
* @param uri String URI
* @param funcClass Class for the function (new instance called).
*/
public void put(String uri, Class<?> funcClass)
{
if ( ! IteratorFunction.class.isAssignableFrom(funcClass) )
{
Log.warn(this, "Class "+funcClass.getName()+" is not a Iterator" );
return ;
}
registry.put(uri, new IteratorFunctionFactoryAuto(funcClass)) ;
}
示例11: getResult
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
Table getResult()
{
if ( stack.size() != 1 )
Log.warn(this, "Warning: getResult: stack size = "+stack.size()) ;
Table table = pop() ;
return table ;
}
示例12: close
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
@Override
public void close() {
if (finished) {
return;
}
try {
closeIterator();
} catch (QueryException ex) {
Log.warn(this, "QueryException in close()", ex);
}
finished = true;
}
示例13: add
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
/** Add a (var,value) - the node value is never null */
@Override
final public void add(Var var, Node node)
{
if ( node == null )
{
Log.warn(this, "Binding.add: null value - ignored") ;
return ;
}
checkAdd(var, node) ;
add1(var, node) ;
}
示例14: StepFilterTDB
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
public StepFilterTDB(ExprList expressions, final NodeTable nodeTable, final FunctionEnv funcEnv) {
this.exprs = expressions ;
this.nodeTable = nodeTable ;
this.filter = new Filter<Row<NodeId>>() {
@Override
public boolean accept(Row<NodeId> row) {
Binding binding = new BindingRow(row, nodeTable) ;
for (Expr expr : exprs)
if ( ! accept(binding, expr) )
return false ;
return true ;
}
private boolean accept(Binding binding, Expr expr) {
try {
if ( expr.isSatisfied(binding, funcEnv) )
return true ;
return false ;
} catch (ExprException ex) { // Some evaluation exception
return false ;
} catch (Exception ex) {
Log.warn(StepFilterTDB.class, "General exception in " + expr, ex) ;
return false ;
}
}
} ;
}
示例15: fetch
import org.apache.jena.atlas.logging.Log; //导入方法依赖的package包/类
/** Access with a predicate-object list */
@Override public Iterator<Row<NodeId>> fetch(PredicateObjectList<NodeId> predObjs) {
Slot<NodeId> gSlot = predObjs.getGraph() ;
if ( gSlot != null && gSlot.isVar() )
Log.warn(this, "Graph variable : "+gSlot) ;
// XXX Union mode.
NodeId g = (gSlot==null) ? null : gSlot.term ;
Slot<NodeId> subject = predObjs.getSubject() ;
if ( subject.isVar() )
return fetchVarSubject(predObjs, g, subject.var) ;
else
return fetchTermSubject(predObjs, g, subject.term) ;
}