if (BigdataValueSerializer.getStringLength(val) < Short.MAX_VALUE) {
if (BigdataValueSerializer.getStringLength(val) < Short.MAX_VALUE) {
/** * Return <code>true</code> iff this {@link Value} would be stored in the * {@link LexiconKeyOrder#BLOBS} index. * * @param v * The value. * * @return <code>true</code> if it is a "large value" according to the * configuration of the lexicon. * * @see AbstractTripleStore.Options#BLOBS_THRESHOLD */ public boolean isBlob(final Value v) { final int blobsThreshold = lexiconConfiguration.getBlobsThreshold(); if (blobsThreshold == 0) return true; final long strlen = BigdataValueSerializer.getStringLength(v); if (strlen >= blobsThreshold) { if (lexiconConfiguration.isBlobsDisabled()) { throw new IllegalArgumentException("Large literal but BLOBS index is disabled: strlen=" + strlen); } return true; } return false; }
/** * Return <code>true</code> iff this {@link Value} would be stored in the * {@link LexiconKeyOrder#BLOBS} index. * * @param v * The value. * * @return <code>true</code> if it is a "large value" according to the * configuration of the lexicon. * * @see AbstractTripleStore.Options#BLOBS_THRESHOLD */ public boolean isBlob(final Value v) { final int blobsThreshold = lexiconConfiguration.getBlobsThreshold(); if (blobsThreshold == 0) return true; final long strlen = BigdataValueSerializer.getStringLength(v); if (strlen >= blobsThreshold) { if (lexiconConfiguration.isBlobsDisabled()) { throw new IllegalArgumentException("Large literal but BLOBS index is disabled: strlen=" + strlen); } return true; } return false; }
/** * If the total length of the Unicode components of the {@link Literal} is * less than {@link #maxInlineTextLength} then return an fully inline * version of the {@link Literal}. * * @param value * The literal. * * @return The fully inline IV -or- <code>null</code> if the {@link Literal} * could not be inlined within the configured constraints. */ private AbstractInlineIV<BigdataLiteral, ?> createInlineUnicodeLiteral( final Literal value) { if (maxInlineTextLength > 0) { /* * Only check the string length if we are willing to turn this into * a fully inline IV. */ final long totalLength = BigdataValueSerializer.getStringLength(value); if (totalLength <= maxInlineTextLength) { return new FullyInlineTypedLiteralIV<BigdataLiteral>( value.getLabel(), value.getLanguage(), value.getDatatype()); } } // Will not inline as Unicode. return null; }
/** * If the total length of the Unicode components of the {@link Literal} is * less than {@link #maxInlineTextLength} then return an fully inline * version of the {@link Literal}. * * @param value * The literal. * * @return The fully inline IV -or- <code>null</code> if the {@link Literal} * could not be inlined within the configured constraints. */ private AbstractInlineIV<BigdataLiteral, ?> createInlineUnicodeLiteral( final Literal value) { if (maxInlineTextLength > 0) { /* * Only check the string length if we are willing to turn this into * a fully inline IV. */ final long totalLength = BigdataValueSerializer.getStringLength(value); if (totalLength <= maxInlineTextLength) { return new FullyInlineTypedLiteralIV<BigdataLiteral>( value.getLabel(), value.getLanguage(), value.getDatatype()); } } // Will not inline as Unicode. return null; }