Class TemplateEntryData
- All Implemented Interfaces:
IEntryData, ServerEntry
- Since:
- 8.0.4
- Author:
- Niv Ingberg
-
Constructor Summary
ConstructorsConstructorDescriptionTemplateEntryData(ITypeDesc typeDesc, ITransportPacket packet, long expirationTime, boolean fromReplication) -
Method Summary
Modifier and TypeMethodDescriptionint[]The fixed properties this template carries a predicate on - the only ones a caller has to get an entry's values for.longGets the entry expiration time.short[]short[]Object[]getFixedPropertyValue(int index) Gets the specified fixed property's value.getPropertyValue(String name) Gets the specified property's value.booleangetRangeInclusion(int index) getRangeValue(int index) intGets the entry version.booleanisAssignableFrom(IServerTypeDesc serverTypeDesc) booleanbooleanisExpired(long limit) booleanbooleanmatch(Context cacheContext, CacheManager cacheManager, ServerEntry entry, int skipAlreadyMatchedFixedPropertyIndex, String skipAlreadyMatchedIndexPath, RegexCache regexCache) booleanmatch(Context cacheContext, CacheManager cacheManager, ServerEntry entry, int skipAlreadyMatchedFixedPropertyIndex, String skipAlreadyMatchedIndexPath, RegexCache regexCache, int rightIndex) booleanmatchFixedProperties(ServerEntry entry, int skipIndex, RegexCache regexCache, int rightIndex) The fixed-property half ofmatch(Context, CacheManager, ServerEntry, int, String, RegexCache, int), over anything that can answer for an entry's property values rather than over an entry that has already been built.voidsetCustomQuery(ICustomQuery customQuery) voidsetDynamicProperties(Map<String, Object> dynamicProperties) voidsetExpirationTime(long expirationTime) voidsetFixedPropertyValue(int index, Object value) voidsetFixedPropertyValues(Object[] values) voidsetVersion(int version) SQLQuery<?> toSQLQuery(ITypeDesc typeDesc) voidupdateData(IEntryData entryData) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IEntryData
getNumOfFixedProperties, getPathValue, getSpaceTypeDescriptor, getTimeToLive, isDummyLease, isHybrid, isView
-
Constructor Details
-
TemplateEntryData
public TemplateEntryData(ITypeDesc typeDesc, ITransportPacket packet, long expirationTime, boolean fromReplication) -
TemplateEntryData
public TemplateEntryData()
-
-
Method Details
-
isExpired
public boolean isExpired() -
isExpired
public boolean isExpired(long limit) -
getEntryDataType
- Specified by:
getEntryDataTypein interfaceIEntryData
-
getDynamicProperties
- Specified by:
getDynamicPropertiesin interfaceIEntryData
-
getVersion
public int getVersion()Description copied from interface:ServerEntryGets the entry version.- Specified by:
getVersionin interfaceServerEntry- Returns:
- the entry version.
-
setVersion
public void setVersion(int version) - Specified by:
setVersionin interfaceIEntryData
-
getExpirationTime
public long getExpirationTime()Description copied from interface:ServerEntryGets the entry expiration time.- Specified by:
getExpirationTimein interfaceServerEntry- Returns:
- the entry expiration time.
-
setExpirationTime
public void setExpirationTime(long expirationTime) -
getFixedPropertyValue
Description copied from interface:ServerEntryGets the specified fixed property's value. The returned value is a reference to the actual property kept in the space.- Specified by:
getFixedPropertyValuein interfaceServerEntry- Parameters:
index- Position of requested property.- Returns:
- Requested property's value in current entry.
-
setFixedPropertyValue
- Specified by:
setFixedPropertyValuein interfaceIEntryData
-
setFixedPropertyValues
- Specified by:
setFixedPropertyValuesin interfaceIEntryData
-
getFixedPropertiesValues
- Specified by:
getFixedPropertiesValuesin interfaceIEntryData
-
updateData
-
getPropertyValue
Description copied from interface:ServerEntryGets the specified property's value. The returned value is a reference to the actual property kept in the space.- Specified by:
getPropertyValuein interfaceIEntryData- Specified by:
getPropertyValuein interfaceServerEntry- Parameters:
name- Name of requested property.- Returns:
- Requested property's value in current entry.
-
getEntryTypeDesc
- Specified by:
getEntryTypeDescin interfaceIEntryData
-
setDynamicProperties
- Specified by:
setDynamicPropertiesin interfaceIEntryData
-
getCustomQuery
-
setCustomQuery
-
getCustomIndexes
-
getRangeValue
-
getRangeInclusion
public boolean getRangeInclusion(int index) -
match
public boolean match(Context cacheContext, CacheManager cacheManager, ServerEntry entry, int skipAlreadyMatchedFixedPropertyIndex, String skipAlreadyMatchedIndexPath, RegexCache regexCache, int rightIndex) -
match
public boolean match(Context cacheContext, CacheManager cacheManager, ServerEntry entry, int skipAlreadyMatchedFixedPropertyIndex, String skipAlreadyMatchedIndexPath, RegexCache regexCache) -
matchFixedProperties
public boolean matchFixedProperties(ServerEntry entry, int skipIndex, RegexCache regexCache, int rightIndex) The fixed-property half ofmatch(Context, CacheManager, ServerEntry, int, String, RegexCache, int), over anything that can answer for an entry's property values rather than over an entry that has already been built.Reachable on its own because a
falsefrom here is a final answer: matching is a conjunction, so no custom query, lease, transaction or generation check can turn a property that failed its predicate into a match. That is what lets a blobstore entry be ruled out against the bytes of the block it lives in, without being decoded first. Atruecarries no such weight - it says only that the fixed properties do not disagree - and a caller of this method alone must not read it as a match. -
constrainedFixedPropertyPositions
public int[] constrainedFixedPropertyPositions()The fixed properties this template carries a predicate on - the only ones a caller has to get an entry's values for. Empty when the template asks about none, which is worth knowing before paying to reach an entry at all.A template can have an
_extendedMatchCodesarray and still constrain nothing: the array is allocated for every property of the type and its default,EQ, means "no predicate" when the matching value is null.Computed once and shared, so callers must not modify the array.
-
getExtendedMatchCodes
public short[] getExtendedMatchCodes() -
getExtendedMatchCodeColumns
public short[] getExtendedMatchCodeColumns() -
toSQLQuery
-
isAssignableFrom
-
isIdQuery
public boolean isIdQuery()
-