Class ColumnValidation
java.lang.Object
org.apache.lucene.document.column.ColumnValidation
Static validation and bounds-checking helpers for the columnar indexing path. These helpers are
pure functions over the public column API and
IndexableFieldType; they do not touch any
indexing-chain state.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckDenseCount(Column column, int consumed, int numDocs) Throws if a dense column did not produce exactlynumDocsvalues.static voidcheckDocID(Column column, int batchDocID, int numDocs) Throws ifbatchDocIDis outside[0, numDocs).static voidcheckVectorDimension(VectorColumn<?> column, int actual, int expected, int batchDocID) Throws if a vector value's length does not match the field's declared dimension.static voidcheckVectorDocIDStrictlyIncreasing(VectorColumn<?> column, int batchDocID, int prevBatchDocID) Throws if a vector cursor doc-id is not strictly greater than the previous one.static intfeatureMask(IndexableFieldType fieldType) Returns a bitmask of the indexing features (FEATURE_*) declared byfieldType.static StringfeatureNames(int mask) Returns a human-readable comma-separated list of the feature names set inmask.static voidvalidateBinaryColumn(BinaryColumn column, IndexableFieldType fieldType) Validates aBinaryColumnagainst the field type it will feed.static voidvalidateColumnHasIndexingFeature(String fieldName, IndexableFieldType fieldType) ThrowsIllegalArgumentExceptioniffieldTypedeclares no indexing feature (no doc values, no points, not stored, no index options, no vectors).static voidvalidateDictionaryColumn(DictionaryColumn column, IndexableFieldType fieldType) Validates aDictionaryColumnagainst the field type it will feed.static voidvalidateLongColumn(LongColumn column, IndexableFieldType fieldType) Validates aLongColumnagainst the field type it will feed.static voidvalidateTokenStreamColumn(TokenStreamColumn column, IndexableFieldType fieldType) Validates aTokenStreamColumnagainst the field type it will feed.static voidvalidateVectorColumn(VectorColumn<?> column, IndexableFieldType fieldType) Validates aVectorColumnagainst the field type it will feed.
-
Method Details
-
featureMask
Returns a bitmask of the indexing features (FEATURE_*) declared byfieldType. Used by the column-batch path to enforce that, when several columns share a field name, each feature is carried by at most one column. -
featureNames
Returns a human-readable comma-separated list of the feature names set inmask. -
validateColumnHasIndexingFeature
ThrowsIllegalArgumentExceptioniffieldTypedeclares no indexing feature (no doc values, no points, not stored, no index options, no vectors). -
validateLongColumn
Validates aLongColumnagainst the field type it will feed. -
validateBinaryColumn
Validates aBinaryColumnagainst the field type it will feed. -
validateDictionaryColumn
Validates aDictionaryColumnagainst the field type it will feed. -
validateTokenStreamColumn
public static void validateTokenStreamColumn(TokenStreamColumn column, IndexableFieldType fieldType) Validates aTokenStreamColumnagainst the field type it will feed. -
validateVectorColumn
Validates aVectorColumnagainst the field type it will feed. -
checkDocID
Throws ifbatchDocIDis outside[0, numDocs). -
checkDenseCount
Throws if a dense column did not produce exactlynumDocsvalues. -
checkVectorDocIDStrictlyIncreasing
public static void checkVectorDocIDStrictlyIncreasing(VectorColumn<?> column, int batchDocID, int prevBatchDocID) Throws if a vector cursor doc-id is not strictly greater than the previous one. -
checkVectorDimension
public static void checkVectorDimension(VectorColumn<?> column, int actual, int expected, int batchDocID) Throws if a vector value's length does not match the field's declared dimension.
-