org.apache.log4j.Logger.isInfoEnabled() - java examples

Here are the examples of the java api org.apache.log4j.Logger.isInfoEnabled() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

155 Examples 7

19 View Complete Implementation : BaseVocabulary.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Add a declared vocabulary.
 *
 * @param decl
 *            The vocabulary declaration.
 */
final protected void addDecl(final VocabularyDecl decl) {
    if (decl == null)
        throw new IllegalArgumentException();
    if (log.isInfoEnabled())
        log.info(decl.getClreplaced().getName());
    decls.add(decl);
}

19 View Complete Implementation : ChunkedWrappedIterator.java
Copyright GNU General Public License v2.0
Author : blazegraph
@Override
public void close() {
    if (open) {
        open = false;
        if (realSource instanceof ICloseableIterator) {
            ((ICloseableIterator<E>) realSource).close();
        }
        if (log.isInfoEnabled())
            log.info("#chunks=" + nchunks + ", #elements=" + nelements);
    }
}

19 View Complete Implementation : SectorAllocator.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * As well as setting the address, this is the point when the
 * allocator can pre-allocate the first set of tags.
 *
 * @param sectorAddress managed by this Allocator
 */
public void setSectorAddress(final long sectorAddress, final int maxsize) {
    if (log.isInfoEnabled())
        log.info("setting sector #" + m_index + " address: " + sectorAddress);
    m_sectorAddress = sectorAddress;
    m_maxSectorSize = maxsize;
    m_addresses[0] = 0;
    for (int i = 0; i < ALLOC_SIZES.length; i++) {
        m_tags[i] = (byte) i;
        m_free[i] = 32;
        m_total[i] = 1;
        // cache block offset
        m_addresses[i + 1] = m_addresses[i] + (32 * ALLOC_SIZES[i]);
    }
    for (int i = ALLOC_SIZES.length; i < NUM_ENTRIES; i++) {
        m_tags[i] = (byte) -1;
    }
    m_onFreeList = true;
    m_store.addToFreeList(this);
}

19 View Complete Implementation : AbstractService.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * This method must be invoked to set the service {@link UUID}.
 * <p>
 * Note: This method gets invoked at different times depending on whether
 * the service is embedded (generally invoked from the service constructor)
 * or written against a service discovery framework (invoked once the
 * service has been replacedigned a UUID by a registrar or during re-start since
 * the service UUID is read from a local file).
 * <p>
 * Several things depend on when this method is invoked, including the setup
 * of the per-service {@link CounterSet} reported by the service to the
 * {@link ILoadBalancerService}.
 *
 * @param serviceUUID
 *            The {@link UUID} replacedigned to the service.
 *
 * @throws IllegalArgumentException
 *             if the parameter is null.
 * @throws IllegalStateException
 *             if the service {@link UUID} has already been set to a
 *             different value.
 */
synchronized public void setServiceUUID(final UUID serviceUUID) throws IllegalStateException {
    if (serviceUUID == null)
        throw new IllegalArgumentException();
    if (this.serviceUUID != null && !this.serviceUUID.equals(serviceUUID)) {
        throw new IllegalStateException();
    }
    if (log.isInfoEnabled())
        log.info("uuid=" + serviceUUID);
    this.serviceUUID = serviceUUID;
}

19 View Complete Implementation : AbstractStatisticsCollector.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Start collecting host performance data -- must be extended by the
 * concrete subclreplaced.
 */
@Override
public void start() {
    if (log.isInfoEnabled())
        log.info("Starting collection.");
    installShutdownHook();
}

19 View Complete Implementation : ResourceEvents.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Report closing of a mutable unisolated named index on an {@link IJournal}.
 *
 * @param name
 *            The index name.
 *
 * @todo never invoked since we do not explicitly close out indices and are
 *       not really able to differentiate the nature of the index when it is
 *       finalized (unisolated vs isolated vs index segment can be
 *       identified based on their interfaces).
 *
 * @todo add reporting for {@link AbstractBTree#reopen()}.
 */
static public void closeUnisolatedIndex(final String name) {
    if (log.isInfoEnabled())
        log.info("name=" + name);
}

19 View Complete Implementation : TestEncodeDecodeValue.java
Copyright GNU General Public License v2.0
Author : blazegraph
/*
    * Test suite for encode/decode of openrdf style contexts. 
    */
/**
 * Test case for <code>foo(s,p,o,(Resource[]) null)</code>. This is case is
 * disallowed.
 *
 * @see com.bigdata.rdf.store.BD#NULL_GRAPH
 * @see <a href="http://trac.bigdata.com/ticket/1177"> Resource... contexts
 *      not encoded/decoded according to openrdf semantics (REST API) </a>
 */
public void test_encodeDecodeContexts_quads_context_null_array() {
    // rejected by encode.
    try {
        EncodeDecodeValue.encodeContexts(null);
        fail("Expecting " + IllegalArgumentException.clreplaced);
    } catch (IllegalArgumentException ex) {
        if (log.isInfoEnabled())
            log.info("Ignoring expected exception: " + ex);
    }
    // rejected by decode.
    try {
        EncodeDecodeValue.decodeContexts(null);
        fail("Expecting " + IllegalArgumentException.clreplaced);
    } catch (IllegalArgumentException ex) {
        if (log.isInfoEnabled())
            log.info("Ignoring expected exception: " + ex);
    }
}

19 View Complete Implementation : Precondition.java
Copyright GNU General Public License v2.0
Author : blazegraph
public boolean accept(ITPS logicalRow) {
    for (IPrecondition c : conditions) {
        if (!c.accept(logicalRow)) {
            if (log.isInfoEnabled()) {
                log.info("Failed: condition=" + c + ", logicalRow=" + logicalRow);
            }
            return false;
        }
    }
    return true;
}

19 View Complete Implementation : QueryUtil.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Generate a {@link Pattern} from the OR of zero or more regular
 * expressions which must be matched.
 *
 * @param regex
 *            A list of regular expressions to be matched (may be null).
 *
 * @return The {@link Pattern} -or- <code>null</code> if both collects are
 *         empty.
 */
static public Pattern getPattern(final Collection<Pattern> regex) {
    final StringBuilder sb = new StringBuilder();
    for (Pattern val : regex) {
        if (log.isInfoEnabled())
            log.info("regex" + "=" + val);
        if (sb.length() > 0) {
            // OR of previous pattern and this pattern.
            sb.append("|");
        }
        // Non-capturing group.
        sb.append("(?:" + val + ")");
    }
    final String s = sb.toString();
    if (log.isInfoEnabled())
        log.info("effective regex filter=" + s);
    return Pattern.compile(s);
}

19 View Complete Implementation : WrappedRemoteChunkedIterator.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Reads a chunk from the source.
 *
 * @throws IOException
 *             If there is an RMI problem.
 */
private void readChunkFromSource() throws IOException {
    // read a chunk from the source.
    final IRemoteChunk<E> chunk = src.nextChunk();
    if (nchunks == 0) {
        // save once.
        keyOrder = chunk.getKeyOrder();
    }
    exhausted = chunk.isExhausted();
    a = chunk.getChunk();
    index = 0;
    if (log.isInfoEnabled()) {
        log.info("nchunks=" + nchunks + ", sourceExhausted=" + exhausted + ", elementsInChunk=" + a.length);
    }
    nchunks++;
}

19 View Complete Implementation : ActiveProcess.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Attaches the reader to the process, which was started by the ctor and
 * is already running.
 *
 * @param processReader
 *            The reader.
 */
public void start(AbstractProcessReader processReader) {
    log.info("");
    if (processReader == null)
        throw new IllegalArgumentException();
    if (readerFuture != null)
        throw new IllegalStateException();
    is = process.getInputStream();
    replacedert is != null;
    /*
         * @todo restart processes if it dies before we shut it down, but no
         * more than some #of tries. if the process dies then we will not have
         * any data for this host.
         * 
         * @todo this code for monitoring processes is a mess and should
         * probably be re-written from scratch. the processReader task
         * references the readerFuture via isAlive() but the readerFuture is not
         * even replacedigned until after we submit the processReader task, which
         * means that it can be running before the readerFuture is set! The
         * concrete implementations of ProcessReaderHelper all poll isAlive()
         * until the readerFuture becomes available.
         */
    if (log.isInfoEnabled())
        log.info("starting process reader: " + processReader);
    processReader.start(is);
    if (log.isInfoEnabled())
        log.info("submitting process reader task: " + processReader);
    readerFuture = readService.submit(processReader);
    if (log.isInfoEnabled())
        log.info("readerFuture: done=" + readerFuture.isDone());
}

19 View Complete Implementation : ResourceEvents.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Report drop of a named unisolated index.
 *
 * @param name
 *            The index name.
 */
static public void dropUnisolatedIndex(final String name) {
    if (log.isInfoEnabled())
        log.info("name=" + name);
}

19 View Complete Implementation : NanoHTTPD.java
Copyright GNU General Public License v2.0
Author : blazegraph
synchronized public void shutdownNow() {
    if (!open)
        return;
    if (log.isInfoEnabled())
        log.info("");
    // Note: Runnable will terminate when open == false.
    open = false;
    acceptService.shutdownNow();
    requestService.shutdownNow();
    try {
        ss.close();
    } catch (IOException e) {
        log.warn(e, e);
    }
}

19 View Complete Implementation : ChunkedConvertingIterator.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Applies the chunk-at-a-time converter. The converted chunk MAY contain a
 * different number of elements. If it does not contain any elements then
 * another chunk will be fetched from the source iterator by
 * {@link #hasNext()}.
 *
 * @param src
 *            A chunk of elements from the source iterator.
 *
 * @return A converted chunk of elements.
 */
protected F[] convert(final IChunkedOrderedIterator<E> src) {
    final F[] tmp = converter.convert(src);
    if (tmp == null)
        throw new replacedertionError("Converter returns null: " + converter.getClreplaced());
    if (log.isInfoEnabled()) {
        log.info("Converted: chunkSize=" + tmp.length + " : chunk=" + Arrays.toString(tmp));
    }
    return tmp;
}

19 View Complete Implementation : TestAST.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * select *
 * where {
 *   predicate1 .
 *   filter2 .
 *   {
 *     predicate3 .
 *     predicate4 .
 *   } union {
 *     predicate5 .
 *     predicate6 .
 *   }
 * }
 */
public void testNestedUnion() {
    final IGroupNode g1 = new JoinGroupNode();
    g1.addChild(sp(3));
    g1.addChild(sp(4));
    final IGroupNode g2 = new JoinGroupNode();
    g2.addChild(sp(5));
    g2.addChild(sp(6));
    final IGroupNode union = new UnionNode();
    union.addChild(g1);
    union.addChild(g2);
    final GraphPatternGroup root = new JoinGroupNode();
    root.addChild(sp(1));
    root.addChild(filter(2));
    root.addChild(union);
    final QueryRoot query = new QueryRoot(QueryType.SELECT);
    query.setWhereClause(root);
    if (log.isInfoEnabled())
        log.info("\n" + query.toString());
}

19 View Complete Implementation : SysstatUtil.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Returns the path to the specified sysstat utility (pidstat, sar, etc).
 * The default is directory is {@value Options#DEFAULT_PATH}. This may be
 * overridden using the {@value Options#PATH} property. The following
 * directories are also searched if the program is not found in the
 * configured default location:
 * <ul>
 * <li>/usr/bin</li>
 * <li>/usr/local/bin</li>
 * </ul>
 *
 * @return The path to the specified utility. If the utility was not found,
 *         then the configured path to the utility will be returned anyway.
 */
static public final File getPath(final String cmd) {
    File f, path;
    final File configuredPath = path = new File(System.getProperty(Options.PATH, Options.DEFAULT_PATH));
    if (log.isInfoEnabled())
        log.info(Options.PATH + "=" + configuredPath);
    if (!(f = new File(path, cmd)).exists() && true) {
        log.warn("Not found: " + f);
        path = new File("/usr/bin");
        if (!(f = new File(path, cmd)).exists()) {
            log.warn("Not found: " + f);
            path = new File("/usr/local/bin");
            if (!(f = new File(path, cmd)).exists()) {
                log.warn("Not found: " + f);
                log.error("Could not locate: '" + cmd + "'. Set '-D" + Options.PATH + "=<dir>'");
                // restore default even though not found.
                path = configuredPath;
            }
        }
    }
    if (configuredPath != path) {
        log.warn("Using effective path: " + Options.PATH + "=" + path);
    }
    return new File(path, cmd);
}

19 View Complete Implementation : ResourceEvents.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Report the isolation of a named index by a transaction.
 *
 * @param startTime
 *            The transaction identifier.
 * @param name
 *            The index name.
 */
static public void isolateIndex(long startTime, String name) {
    if (log.isInfoEnabled())
        log.info("tx=" + startTime + ", name=" + name);
/*
         * Note: there is no separate close for isolated indices - they are
         * closed when the transaction commits or aborts. read-write indices can
         * not be closed before the transactions completes, but read-only
         * indices can be closed early and reopened as required. read-committed
         * indices are always changing over to the most current committed state
         * for an index. both read-only and read-committed indices MAY be shared
         * by more than one transaction (@todo verify that the protocol for
         * sharing is in place on the journal).
         */
}

19 View Complete Implementation : AbstractResourceScanner.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Drain anything left in the queue, transferring it in chunks to the buffer
 * (blocks if the buffer is full).
 */
private void flushQueue() {
    if (log.isInfoEnabled())
        log.info("Flushing queue to buffer.");
    while (!queue.isEmpty()) {
        // transfer a chunk from the queue to the buffer.
        transferChunk();
    }
}

19 View Complete Implementation : HistoryInstrument.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Adds the sample to the history. Samples in the same slot are averaged.
 *
 * @param timestamp
 *            The timestamp.
 * @param value
 *            The value of the counter as of that timestamp.
 */
public void add(final long timestamp, final T value) {
    if (log.isInfoEnabled())
        log.info("timestamp=" + timestamp + ", value=" + value);
    minutes.add(timestamp, value);
}

19 View Complete Implementation : AbstractQueryEngineTestCase.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Verify the expected solutions.
 *
 * @param expected
 * @param itr
 *
 * @deprecated by {@link #replacedertSameSolutions(Future, IBindingSet[], IAsynchronousIterator)}
 */
static public void replacedertSameSolutions(final IBindingSet[] expected, final IAsynchronousIterator<IBindingSet[]> itr) {
    try {
        int n = 0;
        while (itr.hasNext()) {
            final IBindingSet[] e = itr.next();
            if (log.isInfoEnabled())
                log.info(n + " : chunkSize=" + e.length);
            for (int i = 0; i < e.length; i++) {
                if (log.isInfoEnabled())
                    log.info(n + " : " + e[i]);
                if (n >= expected.length) {
                    fail("Willing to deliver too many solutions: n=" + n + " : " + e[i]);
                }
                if (!expected[n].equals(e[i])) {
                    fail("n=" + n + ", expected=" + expected[n] + ", actual=" + e[i]);
                }
                n++;
            }
        }
        replacedertEquals("Wrong number of solutions", expected.length, n);
    } finally {
        itr.close();
    }
}

19 View Complete Implementation : AbstractJoinNexus.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * This variant handles both local indices on a {@link TemporaryStore} or
 * {@link Journal} WITHOUT concurrency controls (fast).
 */
final protected Object runLocalProgram(final ActionEnum action, final IStep step) throws Exception {
    if (log.isInfoEnabled())
        log.info("Running local program: action=" + action + ", program=" + step.getName());
    final IProgramTask innerTask = new ProgramTask(action, step, getJoinNexusFactory(), getIndexManager());
    return innerTask.call();
}

19 View Complete Implementation : RDRHistory.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Get the buffer, create it if necessary.
 */
protected Buffer getOrCreateBuffer() {
    if (buffer == null) {
        if (log.isInfoEnabled()) {
            log.info("starting rdr history");
        }
        tempStore = newTempTripleStore();
        buffer = new Buffer();
    }
    return buffer;
}

19 View Complete Implementation : ResourceEvents.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Report deletion of an {@link IJournal} resource.
 *
 * @param filename
 *            The filename or null iff the journal was not backed by a file.
 *
 * @todo also report deletion of resources for journals that were already
 *       closed but not yet deleted pending client leases or updates of the
 *       metadata index (in the {@link MasterJournal}).
 */
static public void deleteJournal(String filename) {
    if (log.isInfoEnabled())
        log.info("filename=" + filename);
}

19 View Complete Implementation : QuorumServiceBase.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Cancel the requests on the remote services (RMI). This is a best effort
 * implementation. Any RMI related errors are trapped and ignored in order
 * to be robust to failures in RMI when we try to cancel the futures.
 * <p>
 * NOte: This is not being done in parallel. However, due to a DGC thread
 * leak issue, we now use {@link ThickFuture}s. Thus, the tasks that are
 * being cancelled are all local tasks running on the
 * {@link #executorService}. If that local task is doing an RMI, then
 * cancelling it will cause an interrupt in the NIO request.
 */
public static <F extends Future<T>, T> void cancelFutures(final List<F> futures) {
    if (log.isInfoEnabled())
        log.info("");
    for (F f : futures) {
        if (f == null) {
            continue;
        }
        try {
            if (!f.isDone()) {
                f.cancel(true);
            }
        } catch (Throwable t) {
            if (InnerCause.isInnerCause(t, InterruptedException.clreplaced)) {
                // Propagate interrupt.
                Thread.currentThread().interrupt();
            }
        // ignored (to be robust).
        }
    }
}

19 View Complete Implementation : Instrument.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Set the value.
 *
 * @param value
 *            The value.
 * @param timestamp
 *            The timestamp for that value.
 */
final public void setValue(T value, long timestamp) {
    if (log.isInfoEnabled())
        log.info("value=" + value + ", timestamp=" + timestamp);
    this.value = value;
    this.lastModified = timestamp;
}

19 View Complete Implementation : EmptyRowPrecondition.java
Copyright GNU General Public License v2.0
Author : blazegraph
public boolean accept(ITPS logicalRow) {
    if (logicalRow == null) {
        if (log.isInfoEnabled()) {
            log.info("No property values for row: (null)");
        }
        return true;
    }
    if (logicalRow.size() == 0) {
        if (log.isInfoEnabled()) {
            log.info("Logical row size is zero: " + logicalRow);
        }
        return true;
    }
    if (logicalRow.getPrimaryKey() == null) {
        if (log.isInfoEnabled()) {
            log.info("Primary key row is deleted: " + logicalRow);
        }
        return true;
    }
    return false;
}

19 View Complete Implementation : RDRHistory.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Close out the temp store.
 */
@Override
public void close() {
    if (tempStore != null) {
        if (log.isInfoEnabled()) {
            log.info("closing rdr history");
        }
        tempStore.close();
        tempStore = null;
        buffer.reset();
        buffer = null;
    }
}

19 View Complete Implementation : BigdataSubjectCentricFullTextIndex.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * The full text index is currently located in the same namespace as the
 * lexicon relation.  However, the distributed zookeeper locks (ZLocks)
 * are not reentrant.  Therefore this method is overridden to NOT acquire
 * the ZLock for the namespace of the relation when destroying the full
 * text index -- that lock is already held for the same namespace by the
 * {@link LexiconRelation}.
 */
@Override
public void destroy() {
    if (log.isInfoEnabled())
        log.info("");
    replacedertWritable();
    final String name = getNamespace() + "." + NAME_SUBJ_SEARCH;
    getIndexManager().dropIndex(name);
}

19 View Complete Implementation : BloomFilter.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Disables the bloom filter replacedociated with the index. A disabled bloom
 * filter can not be persisted and will not respond to queries or permit
 * mutations.
 * <p>
 * Note: This method is invoked by {@link BTree#insert(byte[], byte[])} when
 * the #of index entries exceeds the maximum allowed for the bloom filter.
 * At that point the {@link BTree} is dirty. {@link Checkpoint} will notice
 * that the bloom filter is disabled will write its address as 0L so the
 * bloom filter is no longer reachable from the post-checkpoint record.
 * <p>
 * @return the current address for recycling
 */
final public long disable() {
    final long ret = addr;
    if (enabled) {
        enabled = false;
        // release the filter impl. this is often 1-10M of data!
        filter = null;
        addr = 0;
        if (log.isInfoEnabled())
            log.info("disabled.");
    }
    return ret;
}

19 View Complete Implementation : TemporaryRawStore.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Closes the store if it gets GCd.
 */
@Override
protected void finalize() throws Throwable {
    try {
        synchronized (buf) {
            if (buf.isOpen()) {
                close();
                if (log.isInfoEnabled())
                    log.info("Finalized temp store");
            }
        }
    } catch (Throwable t) {
        log.error("Ignoring: " + t, t);
    }
    super.finalize();
}

19 View Complete Implementation : CounterSetHTTPDServer.java
Copyright GNU General Public License v2.0
Author : blazegraph
synchronized public void shutdownNow() {
    if (log.isInfoEnabled())
        log.info("begin");
    if (httpd != null) {
        httpd.shutdownNow();
        httpd = null;
    }
    if (log.isInfoEnabled())
        log.info("done");
}

19 View Complete Implementation : ResultSet.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Increase the size of the internal buffers.
 */
private void resize() {
    replacedert limit < 0;
    // double the limit.
    limit = limit * 2;
    int limit = this.limit;
    if (limit < 0)
        limit = -limit;
    if (log.isInfoEnabled()) {
        log.info("resizing buffers: ntuples=" + ntuples + ", new limit=" + limit);
    }
    if (this.keys != null) {
        this.keys = ((AbstractRaba) this.keys).resize(limit);
    }
    if (this.vals != null) {
        this.vals = ((AbstractRaba) this.vals).resize(limit);
    }
    if (this.deleteMarkers != null) {
        final byte[] deleteMarkers = new byte[limit];
        System.arraycopy(this.deleteMarkers, 0, deleteMarkers, 0, ntuples);
        this.deleteMarkers = deleteMarkers;
    }
    if (this.versionTimestamps != null) {
        final long[] versionTimestamps = new long[limit];
        System.arraycopy(this.versionTimestamps, 0, versionTimestamps, 0, ntuples);
        this.versionTimestamps = versionTimestamps;
    }
    if (this.sourceIndices != null) {
        final byte[] sourceIndices = new byte[limit];
        System.arraycopy(this.sourceIndices, 0, sourceIndices, 0, ntuples);
        this.sourceIndices = sourceIndices;
    }
}

19 View Complete Implementation : Stream.java
Copyright GNU General Public License v2.0
Author : blazegraph
final public void setLastCommitTime(final long lastCommitTime) {
    if (lastCommitTime == 0L)
        throw new IllegalArgumentException();
    if (this.lastCommitTime == lastCommitTime) {
        // No change.
        return;
    }
    if (log.isInfoEnabled())
        log.info("old=" + this.lastCommitTime + ", new=" + lastCommitTime);
    // Note: Commented out to allow replay of historical transactions.
    /*if (this.lastCommitTime != 0L && this.lastCommitTime > lastCommitTime) {

            throw new IllegalStateException("Updated lastCommitTime: old="
                    + this.lastCommitTime + ", new=" + lastCommitTime);
            
        }*/
    this.lastCommitTime = lastCommitTime;
}

19 View Complete Implementation : BigdataValueCentricFullTextIndex.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * The full text index is currently located in the same namespace as the
 * lexicon relation.  However, the distributed zookeeper locks (ZLocks)
 * are not reentrant.  Therefore this method is overridden to NOT acquire
 * the ZLock for the namespace of the relation when destroying the full
 * text index -- that lock is already held for the same namespace by the
 * {@link LexiconRelation}.
 */
@Override
public void destroy() {
    if (log.isInfoEnabled())
        log.info("");
    replacedertWritable();
    final String name = getNamespace() + "." + NAME_SEARCH;
    getIndexManager().dropIndex(name);
}

19 View Complete Implementation : TestRootBlockView.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Unit test verifies that we have not run out of space in the root block
 * record.
 *
 * @see RootBlockView#SIZEOF_UNUSED
 */
public void test_unused() {
    if (log.isInfoEnabled())
        log.info("sizeof(RootBlock): " + RootBlockView.SIZEOF_ROOT_BLOCK + ", unused=" + RootBlockView.SIZEOF_UNUSED);
    if (RootBlockView.SIZEOF_UNUSED < 0) {
        fail("Out of space in the root block record: unused=" + RootBlockView.SIZEOF_UNUSED);
    }
}

19 View Complete Implementation : SolutionSetManager.java
Copyright GNU General Public License v2.0
Author : blazegraph
@Override
public boolean clearSolutions(final String solutionSet) {
    if (log.isInfoEnabled())
        log.info("solutionSet: " + solutionSet);
    if (existsSolutions(solutionSet)) {
        final String fqn = getFQN(solutionSet);
        getStore().dropIndex(fqn);
        return true;
    }
    // final SolutionSetStream sset = cacheMap.remove(fqn);
    // 
    // if (sset != null) {
    // sset.clear();
    // 
    // return true;
    // 
    // }
    return false;
}

19 View Complete Implementation : BigdataVertex.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Not bothering to provide a SPARQL translation for vertex queries at
 * this time.  I suspect that scan and filter works fine when starting from
 * an individual vertex.
 */
@Override
public VertexQuery query() {
    if (log.isInfoEnabled())
        log.info("");
    return new DefaultVertexQuery(this);
}

19 View Complete Implementation : TestReificationDoneRightParser.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Unit test verifies that blank nodes may not appear in a triple pattern
 * reference (the semantics of this are explicitly ruled out by the
 * extension).
 */
public void test_triple_ref_pattern_blankNodesAreNotAllowed_subjectPosition() throws MalformedQueryException, TokenMgrError, ParseException {
    final // 
    String sparql = // 
    "prefix : <http://example.com/>\n" + // 
    "prefix dc: <http://purl.org/dc/elements/1.1/>\n" + // 
    "select ?src ?who {\n" + // 
    "  BIND( <<_:a :bought :sybase>> AS ?sid ) . \n" + // 
    "  ?sid dc:source ?src .\n" + "}";
    try {
        parse(sparql, baseURI);
        fail("This construction is not legal.");
    } catch (MalformedQueryException ex) {
        if (log.isInfoEnabled())
            log.info("Ignoring expected exception: " + ex);
    }
}

19 View Complete Implementation : ManagedIntArray.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Return the new capacity for the buffer (default is always large enough
 * and will normally double the buffer capacity each time it overflows).
 *
 * @param required
 *            The minimum required capacity.
 *
 * @return The new capacity.
 *
 * @todo this does not need to be final. also, caller's could set the policy
 *       including a policy that refuses to extend the capacity.
 */
private int extend(final int required) {
    final int capacity = Math.max(required, capacity() * 2);
    if (log.isInfoEnabled())
        log.info("Extending buffer to capacity=" + capacity + " bytes.");
    return capacity;
}

19 View Complete Implementation : Configuration.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Return the name that can be used to override the specified property for
 * the given namespace.
 *
 * @param namespace
 *            The namespace (of an index, relation, etc).
 * @param property
 *            The global property name.
 *
 * @return The name that is used to override that property for that
 *         namespace.
 */
public static String getOverrideProperty(final String namespace, final String property) {
    final String override = NAMESPACE + DOT + namespace + DOT + property;
    if (log.isInfoEnabled()) {
        log.info("namespace=" + namespace + ", property=" + property + ", override=" + override);
    }
    return override;
}

19 View Complete Implementation : GangliaState.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Atomically declare/resolve the metadata for a metric (thread-safe).
 *
 * @param decl
 *            The declaration.
 *
 * @return Either <i>decl</i>, a version of the declaration which was
 *         resolved by the
 *         {@link IGangliaMetadataFactory#resolve(IGangliaMetadataMessage)},
 *         or the pre-existing declaration for the same metric.
 */
public IGangliaMetadataMessage putIfAbsent(final IGangliaMetadataMessage decl) {
    final IGangliaMetadataMessage resolved = metadataFactory.resolve(decl);
    if (resolved == null)
        throw new RuntimeException("Resolution error for " + decl);
    if (!decl.getMetricName().equals(resolved.getMetricName())) {
        // Sanreplacedy check. The metric name should not be changed.
        throw new RuntimeException("Resolution error: decl=" + decl + ", but resolved metricName=" + resolved.getMetricName());
    }
    IGangliaMetadataMessage tmp;
    if ((tmp = metadata.putIfAbsent(decl.getMetricName(), resolved)) == null) {
        // Newly declared.
        if (log.isInfoEnabled())
            log.info("declared: " + resolved);
        return resolved;
    }
    // Already declared or lost a data race.
    return tmp;
}

19 View Complete Implementation : ChunkedConvertingIterator.java
Copyright GNU General Public License v2.0
Author : blazegraph
/*
     * @return true iff there is a non-empty chunk and pos is LT the length of
     * that chunk.
     */
@Override
public boolean hasNext() {
    /*
         * Note: This loops until we either have a non-empty chunk or the source
         * is exhausted. This allows for the possibility that a converter can
         * return an empty chunk, e.g., because all elements in the chunk were
         * filtered out.
         */
    while ((converted == null || pos >= converted.length) && src.hasNext()) {
        // convert the next chunk
        converted = convert(src);
        pos = 0;
    }
    final boolean hasNext = converted != null && pos < converted.length;
    if (log.isInfoEnabled())
        log.info(hasNext);
    // StringWriter sw = new StringWriter();
    // new Exception("stack trace").printStackTrace(new PrintWriter(sw));
    // log.info(sw.toString());
    return hasNext;
}

19 View Complete Implementation : QueryCancellationHelper.java
Copyright GNU General Public License v2.0
Author : blazegraph
public static void cancelQueries(final Collection<UUID> queryIds, final QueryEngine queryEngine) {
    for (UUID queryId : queryIds) {
        if (!tryCancelQuery(queryEngine, queryId)) {
            // TODO:  BLZG-1464  Unify Embedded and REST cancellation
            if (!tryCancelUpdate(queryEngine, queryId, null)) {
                queryEngine.addPendingCancel(queryId);
                if (log.isInfoEnabled()) {
                    log.info("No such QUERY or UPDATE: " + queryId);
                }
            }
        }
    }
}

19 View Complete Implementation : RuleLog.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Log distributed join execution statistics using a CSV format.
 *
 * @param rule
 *            The {@link IRule} whose {@link JoinStats} are being reported.
 * @param ruleState
 *            Contains details about evaluation order for the
 *            {@link IPredicate}s in the tail of the <i>rule</i>, the access
 *            paths that were used, etc.
 * @param joinStats
 *            The statistics for the distributed join tasks for each join
 *            dimension in the rule.
 *
 * @return The table view.
 */
public static void log(final IRule rule, final IRuleState ruleState, final JoinStats[] joinStats) {
    if (log.isInfoEnabled()) {
        log.info(JoinStats.toString(rule, ruleState, joinStats));
    }
}

19 View Complete Implementation : QueryCancellationHelper.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Attempt to cancel a running SPARQL Query
 *
 * @param queryEngine
 * @param queryId
 * @return
 */
public static boolean tryCancelQuery(final QueryEngine queryEngine, final UUID queryId) {
    final IRunningQuery q;
    try {
        q = queryEngine.getRunningQuery(queryId);
    } catch (RuntimeException ex) {
        /*
             * Ignore.
             * 
             * Either the IRunningQuery has already terminated or this is an
             * UPDATE rather than a QUERY.
             */
        return false;
    }
    if (q != null && q.cancel(true)) {
        if (log.isInfoEnabled())
            log.info("Cancelled query: " + queryId);
        return true;
    }
    return false;
}

19 View Complete Implementation : TestAST.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * select *
 * where {
 *   predicate1 .
 *   optional { predicate2 . }
 * }
 */
public void testSimpleOptional() {
    final GraphPatternGroup<IGroupMemberNode> root = new JoinGroupNode();
    root.addChild(sp(1));
    final IGroupNode optional = new JoinGroupNode(true);
    optional.addChild(sp(2));
    root.addChild(optional);
    final QueryRoot query = new QueryRoot(QueryType.SELECT);
    query.setWhereClause(root);
    if (log.isInfoEnabled())
        log.info("\n" + query.toString());
}

19 View Complete Implementation : TestAST.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * select *
 * where {
 *   {
 *     predicate1 .
 *     predicate2 .
 *   } union {
 *     predicate3 .
 *     predicate4 .
 *   }
 * }
 */
public void testUnion() {
    final IGroupNode g1 = new JoinGroupNode();
    g1.addChild(sp(1));
    g1.addChild(sp(2));
    final IGroupNode g2 = new JoinGroupNode();
    g2.addChild(sp(3));
    g2.addChild(sp(4));
    final GraphPatternGroup union = new UnionNode();
    union.addChild(g1);
    union.addChild(g2);
    final QueryRoot query = new QueryRoot(QueryType.SELECT);
    query.setWhereClause(union);
    if (log.isInfoEnabled())
        log.info("\n" + query.toString());
}

19 View Complete Implementation : ResourceEvents.java
Copyright GNU General Public License v2.0
Author : blazegraph
/*
     * Journal file reporting.
     */
/**
 * Report the opening of an {@link IJournal} resource.
 *
 * @param filename
 *            The filename or null iff the journal was not backed by a file.
 * @param nbytes
 *            The total #of bytes available on the journal.
 * @param bufferMode
 *            The buffer mode in use by the journal.
 */
static public void openJournal(String filename, long nbytes, BufferMode bufferMode) {
    if (log.isInfoEnabled())
        log.info("filename=" + filename + ", #bytes=" + nbytes + ", mode=" + bufferMode);
}

19 View Complete Implementation : ActiveProcess.java
Copyright GNU General Public License v2.0
Author : blazegraph
/**
 * Return <code>true</code> unless the process is known to be dead.
 */
public boolean isAlive() {
    if (readerFuture == null || readerFuture.isDone() || process == null || is == null) {
        if (log.isInfoEnabled())
            log.info("Not alive: readerFuture=" + readerFuture + (readerFuture != null ? "done=" + readerFuture.isDone() : "") + ", process=" + process + ", is=" + is);
        return false;
    }
    return true;
}

19 View Complete Implementation : TestSingleTailRule.java
Copyright GNU General Public License v2.0
Author : blazegraph
public void testSingleTail() throws Exception {
    final BigdataSail sail = getSail();
    final BigdataSailRepository repo = new BigdataSailRepository(sail);
    repo.initialize();
    final BigdataSailRepositoryConnection cxn = repo.getConnection();
    cxn.setAutoCommit(false);
    try {
        final ValueFactory vf = sail.getValueFactory();
        final String ns = BD.NAMESPACE;
        URI mike = vf.createURI(ns + "Mike");
        URI likes = vf.createURI(ns + "likes");
        URI rdf = vf.createURI(ns + "RDF");
        /**/
        cxn.setNamespace("ns", ns);
        testValueRoundTrip(cxn.getSailConnection(), mike, likes, rdf);
        if (log.isInfoEnabled()) {
            log.info(cxn.getTripleStore().dumpStore());
        }
    } finally {
        cxn.close();
        if (sail instanceof BigdataSail)
            ((BigdataSail) sail).__tearDownUnitTest();
    }
}