Refine search
private void evictStaleEntries() { int evicted = 0; Reference<? extends V> sv; while ((sv = refQueue.poll()) != null) { final K key = reverseLookup.remove(sv); if (key != null) { hashCodes.remove(key); evicted++; } } if (evicted > 0) OLogManager.instance().debug(this, "Evicted %d items", evicted); }
private String validateAlgorithm(final String iAlgorithm) { String validAlgo = iAlgorithm; if (!isAlgorithmSupported(iAlgorithm)) { // Downgrade it to PBKDF2_ALGORITHM. validAlgo = PBKDF2_ALGORITHM; OLogManager.instance().debug(this, "The %s algorithm is not supported, downgrading to %s", iAlgorithm, validAlgo); } return validAlgo; }
public void endResponse() throws IOException { channelRead = false; // WAKE UP ALL THE WAITING THREADS try { readCondition.signalAll(); } catch (IllegalMonitorStateException e) { // IGNORE IT OLogManager.instance().debug(this, "Error on signaling waiting clients after reading response"); } try { releaseReadLock(); } catch (IllegalMonitorStateException e) { // IGNORE IT OLogManager.instance().debug(this, "Error on unlocking network channel after reading response"); } }
public boolean returnResource(final V res) { if (resourcesOut.remove(res)) { resources.add(res); sem.release(); if (OLogManager.instance().isDebugEnabled()) OLogManager.instance() .debug(this, "pool:'%s' returned resource '%s' available %d out %d", this, res, sem.availablePermits(), resourcesOut.size()); } return true; }
public void remove(final V res) { if (resourcesOut.remove(res)) { this.resources.remove(res); sem.release(); if (OLogManager.instance().isDebugEnabled()) OLogManager.instance().debug(this, "pool:'%s' removed resource '%s' available %d out %d", this, res, sem.availablePermits(), resourcesOut.size()); } }
public OCredentialInterceptor newCredentialInterceptor() { OCredentialInterceptor ci = null; try { String ciClass = OGlobalConfiguration.CLIENT_CREDENTIAL_INTERCEPTOR.getValueAsString(); if (ciClass != null) { Class<?> cls = Class.forName(ciClass); // Throws a ClassNotFoundException if not found. if (OCredentialInterceptor.class.isAssignableFrom(cls)) { ci = (OCredentialInterceptor) cls.newInstance(); } } } catch (Exception ex) { OLogManager.instance().debug(this, "newCredentialInterceptor() Exception creating CredentialInterceptor", ex); } return ci; }
@Override public void onCompletition(final Object iTask, final boolean iSucceed) { final long idxSize = idx.getSize(); if (idxSize > 0) if (rebuild) OLogManager.instance().info(this, "--> OK, indexed %,d items in %,d ms", idxSize, (System.currentTimeMillis() - startTime)); else OLogManager.instance() .debug(this, "--> OK, indexed %,d items in %,d ms", idxSize, (System.currentTimeMillis() - startTime)); } }
public synchronized void queryStarted(String id, OResultSet rs) { if (this.activeQueries.size() > 1 && this.activeQueries.size() % 10 == 0) { StringBuilder msg = new StringBuilder(); msg.append("This database instance has "); msg.append(activeQueries.size()); msg.append(" open command/query result sets, please make sure you close them with OResultSet.close()"); OLogManager.instance().warn(this, msg.toString(), null); if (OLogManager.instance().isDebugEnabled()) { activeQueries.values().stream().map(pendingQuery -> pendingQuery.getExecutionPlan()).filter(plan -> plan != null) .forEach(plan -> OLogManager.instance().debug(this, plan.toString())); } } this.activeQueries.put(id, rs); }
@Override public IndexWriter openIndexWriter(Directory directory, ODocument metadata) throws IOException { Analyzer analyzer = getAnalyzer(metadata); Version version = getLuceneVersion(metadata); IndexWriterConfig iwc = new IndexWriterConfig(version, analyzer); iwc.setOpenMode(IndexWriterConfig.OpenMode.APPEND); OLogManager.instance().debug(this, "Opening Lucene index in '%s'...", directory); return new IndexWriter(directory, iwc); }
@Override public void onDrop(final ODatabaseInternal db) { try { if (db.isClosed()) return; OLogManager.instance().debug(this, "Dropping Lucene indexes..."); db.getMetadata().getIndexManager().getIndexes().stream().filter(idx -> idx.getInternal() instanceof OLuceneFullTextIndex) .peek(idx -> OLogManager.instance().debug(this, "deleting index " + idx.getName())).forEach(idx -> idx.delete()); } catch (Exception e) { OLogManager.instance().warn(this, "Error on dropping Lucene indexes", e); } }