public abstract class AbstractQueryRecorderFilter<T> extends ExternalizableHelper implements QueryRecorderFilter<T>
QueryRecorderFilter
.ExternalizableHelper.DecoratedMultiBufferReadBuffer, ExternalizableHelper.DefaultObjectStreamFactory, ExternalizableHelper.FormatAwareCompressor, ExternalizableHelper.IntDecoratedObject, ExternalizableHelper.Shielded, ExternalizableHelper.ShieldedDataOutputStream, ExternalizableHelper.ShieldedInputStream, ExternalizableHelper.ShieldedObjectOutputStream, ExternalizableHelper.ShieldedOutputStream, ExternalizableHelper.SimpleXmlBeanClassCache, ExternalizableHelper.Stats, ExternalizableHelper.XmlBeanClassCache
Base.LoggingWriter, Base.StackFrame
CONVERTER_FROM_BINARY, CONVERTER_STRIP_INTDECO, CONVERTER_TO_BINARY, DECO_APP_1, DECO_APP_2, DECO_APP_3, DECO_CUSTOM, DECO_EXPIRY, DECO_ID_MAX, DECO_ID_MIN, DECO_JCACHE, DECO_JCACHE_SYNTHETIC, DECO_MEMCACHED, DECO_PUSHREP, DECO_QUEUE_METADATA, DECO_RSVD_1, DECO_RSVD_2, DECO_STORE, DECO_TOPLINK, DECO_TX, DECO_VALUE, DECO_WLS, EMPTY_BINARY_ARRAY, FMT_B_ARRAY, FMT_BIN_DECO, FMT_BIN_EXT_DECO, FMT_BINARY, FMT_BOOLEAN, FMT_BYTE, FMT_DECIMAL, FMT_DOUBLE, FMT_EXT, FMT_FLOAT, FMT_IDO, FMT_INT, FMT_INTEGER, FMT_LONG, FMT_NONE, FMT_NULL, FMT_OBJ_EXT, FMT_OBJ_SER, FMT_OPT, FMT_OPT_DOUBLE, FMT_OPT_INT, FMT_OPT_LONG, FMT_SHORT, FMT_STRING, FMT_UNKNOWN, FMT_XML_BEAN, FMT_XML_SER, FORCE_RESOLVING_STREAMS, MAX_DECO_HEADER_BYTES, PROPERTY_CONFIG, s_streamfactory, TRINT_DOMAIN_SPAN, TRINT_MAX_VALUE, TRINT_MAX_VARIANCE, USE_POF_STREAMS, USE_XMLBEAN_CLASS_CACHE, XMLBEAN_CLASS_CACHE
Constructor and Description |
---|
AbstractQueryRecorderFilter() |
Modifier and Type | Method and Description |
---|---|
protected static <T> void |
explain(Filter<T> filter, Map mapIndexes, Set setKeys, QueryRecord.PartialResult.ExplainStep step)
Record an estimated cost of query execution for a given filter.
|
protected static <T> void |
explain(Filter<T> filter, Map mapIndexes, Set setKeys, QueryRecord.PartialResult.ExplainStep step, ValueExtractor extractor)
Record an estimated cost of query execution for a given filter.
|
void |
explain(QueryContext ctx, QueryRecord.PartialResult.ExplainStep step, Set setKeys)
Record the projected query execution cost by this filter.
|
protected static <T> boolean |
trace(Filter<T> filter, Map.Entry entry, QueryRecord.PartialResult.TraceStep step)
Record the actual cost of query execution for a given filter.
|
protected static <T> Filter<T> |
trace(Filter<T> filter, Map mapIndexes, Set setKeys, QueryRecord.PartialResult.TraceStep step)
Record the actual cost of applying the specified filter to the specified keySet.
|
protected static <T> Filter<T> |
trace(Filter<T> filter, Map mapIndexes, Set setKeys, QueryRecord.PartialResult.TraceStep step, ValueExtractor extractor)
Record the actual cost of applying the specified filter to the specified keySet.
|
boolean |
trace(QueryContext ctx, QueryRecord.PartialResult.TraceStep step, Map.Entry entry)
Evaluate the specified entry against this filter and record the evaluation cost on the given step of the
QueryRecord . |
Filter |
trace(QueryContext ctx, QueryRecord.PartialResult.TraceStep step, Set setKeys)
Filter the given keys using available indexes and record the cost of execution on the given step of the
QueryRecord . |
asBinary, calculatePackedLength, calculatePackedLength, convertUTF, decodeExpiry, decorate, decorate, decorate, decorate, decorate, decorateBinary, encodeExpiry, ensureSerializer, extractIntDecoration, fromBinary, fromBinary, fromBinary, fromByteArray, fromByteArray, getDecoration, getDecoration, getDecorations, getDeltaCompressor, getInputStream, getNewObjectInput, getObjectInput, getObjectOutput, getObjectStreamFactory, getOutputStream, getShieldedOutputStream, getStreamFormat, getUndecorated, getUndecorated, isDecorated, isDecorated, isIntDecorated, isIntDecorated, isResolving, isSerializable, isSerializerCompatible, isVersionCompatible, isVersionCompatible, loadClass, loadResource, main, makeTrint, readBigDecimal, readBigInteger, readBooleanArray, readByteArray, readCollection, readDate, readDoubleArray, readExternalizableLite, readExternalizableLite, readFloatArray, readInt, readInt, readIntArray2d, readLong, readLong, readMap, readMap, readObject, readObject, readSafeUTF, readSafeUTF, readSerializable, readSerializable, readStringArray, readTime, readTimestamp, readTrint, readUnsignedTrint, readUTF, readXmlBean, readXmlSerializable, readXmlSerializable, realize, removeIntDecoration, removeIntDecoration, replace, reportIncompatibleSerializers, setObjectStreamFactory, toBinary, toBinary, toByteArray, toByteArray, toByteArray, toLiteBinary, toLong, undecorate, undecorate, validateBufferSize, writeBigDecimal, writeBigInteger, writeBooleanArray, writeByteArray, writeCollection, writeDate, writeDoubleArray, writeExternalizableLite, writeFloatArray, writeInt, writeInt, writeIntArray2d, writeLong, writeLong, writeMap, writeObject, writeSafeUTF, writeSafeUTF, writeSerializable, writeStringArray, writeTime, writeTimestamp, writeTrint, writeTrint, writeUTF, writeXmlBean, writeXmlSerializable
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString, toBytes, toBytes, toBytes, toBytes, toInt, toInt, toLong
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
and, asLimitFilter, associatedWith, evaluate, forKeys, forPartitions, or, xor
public void explain(QueryContext ctx, QueryRecord.PartialResult.ExplainStep step, Set setKeys)
This method is expected to record the order of execution and estimated cost of applying corresponding indexes in the given step
without actually applying any indexes or evaluating entries.
explain
in interface QueryRecorderFilter<T>
ctx
- the query contextstep
- the step used to record the estimated execution costsetKeys
- the set of keys that would be filteredpublic Filter trace(QueryContext ctx, QueryRecord.PartialResult.TraceStep step, Set setKeys)
QueryRecord
.
This method should record the size of the given key set before and after applying corresponding indexes using QueryRecord.PartialResult.RecordableStep.recordPreFilterKeys(int)
and QueryRecord.PartialResult.TraceStep.recordPostFilterKeys(int)
as well as the corresponding execution time using the QueryRecord.PartialResult.TraceStep.recordDuration(long)
method.
This method is only called if the filter is an IndexAwareFilter
and its implementations should explicitly call applyIndex()
to actually perform the query. Additionally, this method should return the filter object (if any) returned by the applyIndex() call.
trace
in interface QueryRecorderFilter<T>
ctx
- the query contextstep
- the step used to record the execution costsetKeys
- the mutable set of keys that remain to be filteredIndexAwareFilter.applyIndex(Map, Set)
public boolean trace(QueryContext ctx, QueryRecord.PartialResult.TraceStep step, Map.Entry entry)
QueryRecord
.
This method should record the corresponding latencies using QueryRecord.PartialResult.TraceStep.recordDuration(long)
.
Implementations are responsible for explicitly calling evaluateEntry()
method to perform the actual entry evaluation. Additionally, this method should return the result of the evaluateEntry call.
trace
in interface QueryRecorderFilter<T>
ctx
- the contextstep
- the step used to record the evaluation costentry
- the entry to evaluateEntryFilter.evaluateEntry(Map.Entry)
protected static <T> void explain(Filter<T> filter, Map mapIndexes, Set setKeys, QueryRecord.PartialResult.ExplainStep step)
filter
- the filtermapIndexes
- a read-only map of available MapIndex objects, keyed by the associated ValueExtractorsetKeys
- the mutable set of keys that remain to be filteredstep
- the step used to record the execution costprotected static <T> void explain(Filter<T> filter, Map mapIndexes, Set setKeys, QueryRecord.PartialResult.ExplainStep step, ValueExtractor extractor)
filter
- the filtermapIndexes
- a read-only map of available MapIndex objects, keyed by the associated ValueExtractorsetKeys
- the mutable set of keys that remain to be filteredstep
- the step used to record the execution costextractor
- an optional ValueExtractor used by the queryprotected static <T> Filter<T> trace(Filter<T> filter, Map mapIndexes, Set setKeys, QueryRecord.PartialResult.TraceStep step)
filter
- the filtermapIndexes
- a read-only map of available MapIndex objects, keyed by the associated ValueExtractorsetKeys
- the mutable set of keys that remain to be filteredstep
- the step used to record the execution costFilter
object (which may be an EntryFilter
) that can be used to process the remaining keys, or null if no additional filter processing is necessaryprotected static <T> Filter<T> trace(Filter<T> filter, Map mapIndexes, Set setKeys, QueryRecord.PartialResult.TraceStep step, ValueExtractor extractor)
filter
- the filtermapIndexes
- a read-only map of available MapIndex objects, keyed by the associated ValueExtractorsetKeys
- the mutable set of keys that remain to be filteredstep
- the step used to record the execution costextractor
- an optional ValueExtractor used by the queryFilter
object (which may be an EntryFilter
) that can be used to process the remaining keys, or null if no additional filter processing is necessaryprotected static <T> boolean trace(Filter<T> filter, Map.Entry entry, QueryRecord.PartialResult.TraceStep step)
filter
- the filterentry
- the entry to be evaluatedstep
- the step used to record the execution cost