Class ResolvedKeySpacePath
- java.lang.Object
-
- com.apple.foundationdb.record.provider.foundationdb.keyspace.ResolvedKeySpacePath
-
public class ResolvedKeySpacePath extends Object
AKeySpacePath
that has been resolved into the value that will be physically stored to represent the path element in the FDB keyspace. AKeySpacePath
represents a path through a logical directory tree defined by aKeySpaceDirectory
. Some directories, such as a theDirectoryLayerDirectory
logically represent their values in one format (such as a string) but store their version in another "resolved" format (such as a long). AResolvedKeySpacePath
represents the value for a path entry as resolved from aKeySpacePath
.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ResolvedKeySpacePath(ResolvedKeySpacePath parent, KeySpacePath inner, PathValue value, Tuple remainder)
Create a resolved keyspace path.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
appendValue(StringBuilder sb, Object value)
boolean
equals(Object other)
List<ResolvedKeySpacePath>
flatten()
Flattens the path into a list ofResolvedKeySpacePath
entries, with the root of the path located at position 0.KeySpaceDirectory
getDirectory()
Returns the directory that corresponds to this path entry.String
getDirectoryName()
Returns the directory name for this path element.Object
getLogicalValue()
Returns the logical value (prior to resolving) for this path element.ResolvedKeySpacePath
getParent()
Returns the parent path element.Tuple
getRemainder()
If this path was created viaKeySpace.resolveFromKey(FDBRecordContext, Tuple)
, this returns any remaining portion of the input tuple that was not used to construct the path.byte[]
getResolvedMetadata()
Returns any metadata that may be stored along with the resolved value for this path element.PathValue
getResolvedPathValue()
Returns the value that will be physically stored to represent this path element along with any metadata that may be associated with it.Object
getResolvedValue()
Returns the value that will be physically stored to represent this path element.int
hashCode()
int
size()
Get the length of the path.KeySpacePath
toPath()
Convert the resolved path back into aKeySpacePath
.String
toString()
Subspace
toSubspace()
Tuple
toTuple()
Converts the resolved path into aTuple
.
-
-
-
Constructor Detail
-
ResolvedKeySpacePath
protected ResolvedKeySpacePath(@Nullable ResolvedKeySpacePath parent, @Nonnull KeySpacePath inner, @Nonnull PathValue value, @Nullable Tuple remainder)
Create a resolved keyspace path.- Parameters:
parent
- the parent resolved pathinner
- the path for which the value was resolvedvalue
- the resolved valueremainder
- if the path was resolved from aTuple
this is the remaining portion that extends beyond the end of the path.
-
-
Method Detail
-
size
public int size()
Get the length of the path.- Returns:
- the length of the path
-
getParent
@Nullable public ResolvedKeySpacePath getParent()
Returns the parent path element.- Returns:
- the parent path element or
null
if this is the root of the path
-
getDirectoryName
@Nonnull public String getDirectoryName()
Returns the directory name for this path element.- Returns:
- the directory name
-
getDirectory
@Nonnull public KeySpaceDirectory getDirectory()
Returns the directory that corresponds to this path entry.- Returns:
- returns the directory that corresponds to this path entry
-
getLogicalValue
@Nullable public Object getLogicalValue()
Returns the logical value (prior to resolving) for this path element.- Returns:
- the logical value for this path element
-
getResolvedPathValue
@Nonnull public PathValue getResolvedPathValue()
Returns the value that will be physically stored to represent this path element along with any metadata that may be associated with it.- Returns:
- the value that will be stored stored for the path element
-
getResolvedValue
@Nullable public Object getResolvedValue()
Returns the value that will be physically stored to represent this path element.- Returns:
- the value that will be stored stored for the path element
-
getResolvedMetadata
@Nullable public byte[] getResolvedMetadata()
Returns any metadata that may be stored along with the resolved value for this path element. Metadata is produced fromDirectoryLayerDirectory
entries in which theLocatableResolver
that is performing the string to long mapping is also configured to store additional metadata associated with that entry.- Returns:
- the metadata that is stored along with the resolved value for this path element or
null
if there is no metadata
-
toTuple
@Nonnull public Tuple toTuple()
Converts the resolved path into aTuple
.- Returns:
- the
Tuple
form of the resolved path
-
toPath
@Nonnull public KeySpacePath toPath()
Convert the resolved path back into aKeySpacePath
.- Returns:
- The
KeySpacePath
for this resolved path
-
getRemainder
@Nullable public Tuple getRemainder()
If this path was created viaKeySpace.resolveFromKey(FDBRecordContext, Tuple)
, this returns any remaining portion of the input tuple that was not used to construct the path.- Returns:
- the remaining portion of the original input tuple or
null
-
flatten
@Nonnull public List<ResolvedKeySpacePath> flatten()
Flattens the path into a list ofResolvedKeySpacePath
entries, with the root of the path located at position 0.- Returns:
- this path as a list
-
appendValue
public static void appendValue(StringBuilder sb, Object value)
-
-