本文整理汇总了Java中org.apache.jena.atlas.logging.FmtLog.info方法的典型用法代码示例。如果您正苦于以下问题:Java FmtLog.info方法的具体用法?Java FmtLog.info怎么用?Java FmtLog.info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jena.atlas.logging.FmtLog
的用法示例。
在下文中一共展示了FmtLog.info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fetch
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
/** Retrieve a patch by version. */
@Override
public RDFPatch fetch(Id dsRef, long version) {
checkLink();
DataSource source = getDataSourceOrNull(dsRef);
if ( source == null )
return null;
RDFPatch patch = source.getPatchLog().fetch(version);
if ( LOG.isInfoEnabled() ) {
if ( patch == null ) {
FmtLog.info(LOG, "fetch: Dest=%s, Version=%d, Not found", source, version);
} else {
Id id = Id.fromNode(patch.getId());
FmtLog.info(LOG, "fetch: Dest=%s, Version=%d, Patch=%s", source, version, id);
}
}
return patch;
}
示例2: allocNodeIds
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
@Override
public List<TLZ_NodeId> allocNodeIds(long id, long txnId, List<RDF_Term> nodes) throws TException {
FmtLog.info(log, "[%d] allocNodeIds(%d) : txnId = %d", id, nodes.size(), txnId) ;
checkActive() ;
return txnAlwaysReturn(txnId, WRITE, ()-> {
// Local bulk operations?
List<TLZ_NodeId> nodeids = new ArrayList<>(nodes.size()) ;
for ( RDF_Term nz : nodes ) {
Node n = decodeFromTLZ(nz) ;
NodeId nid = nodeTable.getAllocateNodeId(n) ;
TLZ_NodeId nidz = new TLZ_NodeId() ;
nidz.setNodeId(nid.getId()) ;
nodeids.add(nidz) ;
//FmtLog.info(log, "[%d:%d] Batched node alloc : %s => %s", id, txnId, n, nid) ;
}
return nodeids ;
}) ;
}
示例3: end
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
@Override
public void end() {
Long z = getTxnId() ;
/*if ( z != null )*/ {
if ( z < 0 ) {
if ( LOG_TXN )
FmtLog.info(getLog(), "[Txn:%s:%d] end (no call)", getLabel(), getTxnId());
} else {
if ( LOG_TXN )
FmtLog.info(getLog(), "[Txn:%s:%d] end", getLabel(), getTxnId());
ThriftLib.exec(lock, () -> rpc.txnEnd(getTxnId())) ;
}
currentTxnId.set(null) ;
}
// Because get may have created it.
currentTxnId.remove() ;
}
示例4: append
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
@Override
public long append(Id dsRef, RDFPatch rdfPatch) {
checkLink();
checkRegistered();
DataSource source = getDataSource(dsRef);
// Patch not known to be valid yet.
// Patch not safe in the Patch Log yet.
PatchLog patchLog = source.getPatchLog();
try {
beforeWrite(source, patchLog, rdfPatch);
// FmtLog.info(LOG, "append: start: Patch=%s ds=%s", str(rdfPatch.getId()),
// source);
long t1 = System.currentTimeMillis();
long version = patchLog.append(rdfPatch);
long t2 = System.currentTimeMillis();
afterWrite(source, rdfPatch, version, (t2 - t1));
return version;
}
catch (RuntimeException ex) {
badWrite(source, patchLog, rdfPatch, ex);
FmtLog.info(LOG, "append: Failed: Dest=%s Patch=%s ; %s", source, str(rdfPatch.getId()), ex.getMessage());
// Stack trace logged higher up if relevant.
throw ex;
}
}
示例5: afterWrite
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
/** Called after writing the patch to the {@link PatchLog}. */
protected void afterWrite(DataSource source, RDFPatch rdfPatch, long version, long timeElapsed) {
// FmtLog.info(LOG, "append: finish: Patch=%s[ver=%d] ds=%s",
// str(rdfPatch.getId()), version, source);
//FmtLog.info(LOG, "append (%.3fs): Patch=%s[ver=%d] ds=%s", (timeElapsed / 1000.0), str(rdfPatch.getId()), version, source);
FmtLog.info(LOG, "append : Patch=%s[ver=%d] ds=%s", str(rdfPatch.getId()), version, source);
}
示例6: handle
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
/** Safe handler */
@Override
public void handle(Patch patch) {
PatchSummary scc = RDFPatchOps.summary(patch) ;
FmtLog.info(log,
"Patch: Quads: add=%d, delete=%d :: Prefixes: add=%d delete=%d",
scc.countAddData, scc.countDeleteData,
scc.countAddPrefix, scc.countDeletePrefix) ;
}
示例7: attach
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
public static FileStore attach(Location dirname, String basename) {
Objects.requireNonNull(dirname, "argument 'dirname' is null");
Objects.requireNonNull(basename, "argument 'basename' is null");
if ( basename.equals(tmpBasename) )
throw new IllegalArgumentException("FileStore.attach: basename is equal to the reserved name '"+tmpBasename+"'") ;
Path dirPath = IOX.asPath(dirname);
Path k = key(dirPath, basename);
if ( areas.containsKey(k) )
return areas.get(k);
if ( ! Files.exists(dirPath) || ! Files.isDirectory(dirPath) )
throw new IllegalArgumentException("FileStore.attach: Path '" + dirPath + "' does not name a directory");
// Delte any tmp files leaft lying around.
// Find existing files.
List<Long> indexes = scanForIndex(dirPath, basename);
long min;
long max;
if ( indexes.isEmpty() ) {
min = DeltaConst.VERSION_INIT;
// So increment is the next version.
max = DeltaConst.VERSION_FIRST - 1;
FmtLog.info(LOG, "FileStore : index [--,%d] %s", max, dirname);
} else {
min = indexes.get(0);
max = indexes.get(indexes.size()-1);
if ( LOG.isDebugEnabled() ) FmtLog.debug(LOG, "FileStore : index [%d,%d] %s", min, max, dirname);
}
FileStore fs = new FileStore(dirPath, basename, indexes, min, max);
areas.put(k, fs);
return fs;
}
示例8: register
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
public static void register(PatchStore impl) {
String providerName = impl.getProviderName();
FmtLog.info(LOG, "Register patch store: %s", providerName);
if ( patchStores.containsKey(providerName) )
Log.error(PatchStore.class, "Already registered: "+providerName);
patchStores.put(providerName, impl);
}
示例9: setDftPatchStoreName
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
public static void setDftPatchStoreName(String providerName) {
PatchStore impl = patchStores.get(providerName);
if ( impl == null )
throw new DeltaConfigException("No provider for '"+providerName+"'");
dftPatchStore = impl;
FmtLog.info(LOG, "Set default patch store: %s", providerName);
}
示例10: fetchCommon
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
private RDFPatch fetchCommon(Id dsRef, String param, Object value, String valueLogStr) {
checkLink();
String url = remoteReceive;
url = createURL(url, DeltaConst.paramDatasource, dsRef.asParam());
url = appendURL(url, value.toString());
url = addToken(url);
final String s = url;
FmtLog.info(Delta.DELTA_HTTP_LOG, "Fetch request: %s %s=%s [%s]", dsRef, param, valueLogStr, url);
try {
return retry(()->{
// [NET] Network point
InputStream in = HttpOp.execHttpGet(s) ;
if ( in == null )
return null ;
RDFPatchReaderText pr = new RDFPatchReaderText(in) ;
RDFChangesCollector collector = new RDFChangesCollector();
pr.apply(collector);
return collector.getRDFPatch();
}, ()->true, ()->"Retry fetch patch.", ()->"Failed to fetch patch.");
}
catch ( HttpException ex) {
if ( ex.getResponseCode() == HttpSC.NOT_FOUND_404 )
return null ; //throw new DeltaNotFoundException(ex.getMessage());
throw ex;
}
}
示例11: syncToVersion
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
/** Sync until some version */
private void syncToVersion(long version) {
//long remoteVer = getRemoteVersionLatestOrDefault(VERSION_UNSET);
if ( version == VERSION_UNSET ) {
FmtLog.warn(LOG, "Sync: Failed to sync");
return;
}
long localVer = getLocalVersion();
// -1 ==> no entries, uninitialized.
if ( localVer < 0 ) {
FmtLog.info(LOG, "Sync: No log entries");
localVer = 0 ;
setLocalState(localVer, (Node)null);
return;
}
if ( localVer > version )
FmtLog.info(LOG, "[%s] Local version ahead of remote : [local=%d, remote=%d]", datasourceId, getLocalVersion(), getRemoteVersionCached());
if ( localVer >= version )
return;
// bring up-to-date.
FmtLog.info(LOG, "Sync: Versions [%d, %d]", localVer, version);
playPatches(localVer+1, version) ;
//FmtLog.info(LOG, "Now: Versions [%d, %d]", getLocalVersion(), remoteVer);
}
示例12: play
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
/** Play patches, return details of the the last successfully applied one */
private static Pair<Long, Node> play(Id datasourceId, RDFChanges target, DeltaLink dLink, long minVersion, long maxVersion) {
// [Delta] replace with a one-shot "get all patches" operation.
//FmtLog.debug(LOG, "Patch range [%d, %d]", minVersion, maxVersion);
Node patchLastIdNode = null;
long patchLastVersion = VERSION_UNSET;
for ( long ver = minVersion ; ver <= maxVersion ; ver++ ) {
//FmtLog.debug(LOG, "Play: patch=%d", ver);
RDFPatch patch;
try {
patch = dLink.fetch(datasourceId, ver);
if ( patch == null ) {
FmtLog.info(LOG, "Play: %s patch=%d : not found", datasourceId, ver);
continue;
}
} catch (DeltaNotFoundException ex) {
// Which ever way it is signalled. This way means "bad datasourceId"
FmtLog.info(LOG, "Play: %s patch=%d : not found", datasourceId, ver);
continue;
}
RDFChanges c = target;
if ( false )
c = DeltaOps.print(c);
patch.apply(c);
patchLastIdNode = patch.getId();
patchLastVersion = ver;
}
return Pair.create(patchLastVersion, patchLastIdNode);
}
示例13: begin
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
@Override
public void begin(long txnId, ReadWrite mode) {
if ( LOG_TXN )
FmtLog.info(getLog(), "[Txn:%s:%d] begin/%s", getLabel(), txnId, mode.toString().toLowerCase());
try { rpcBegin(txnId, mode) ; }
catch (LizardException ex) {
// Attempt to restart.
rpc = null ;
resetConnection() ;
rpcBegin(txnId, mode) ;
}
currentTxnId.set(txnId) ;
}
示例14: prepare
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
@Override
public void prepare() {
completeAsyncOperations() ;
if ( LOG_TXN )
FmtLog.info(getLog(), "[Txn:%s:%d] prepare", getLabel(), getTxnId());
ThriftLib.exec(lock, ()-> rpc.txnPrepare(getTxnId())) ;
}
示例15: txnBegin
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
private void txnBegin(long txnId, ReadWrite mode) {
if ( LOG_TXN )
FmtLog.info(logtxn(), "[Txn:%s:%d] begin[%s]", getLabel(), txnId, mode) ;
transactional.begin(mode) ;
TransactionCoordinatorState txnState = transactional.detach() ;
if ( transactions.containsKey(txnId) )
log().warn("TxnHandler - Transaction already exists") ;
transactions.put(txnId, txnState) ;
}