@Override public void addTokenTrackingAttribute(List<Integer> positions) { //TokenTrackingAttribute is no longer available throw new SearchException( "Serialization of TokenTrackingAttribute is no longer supported" ); }
public List<LuceneWork> getSealedQueue() { if ( sealedQueue == null ) { throw new AssertionFailure( "Access a WorkQueue which has not been sealed" ); } this.sealedAndUnchanged = false; return sealedQueue; }
public static byte fromIntToByte(int i) { if ( i > 255 ) { throw new SearchException( "Int is too long to be encoded" ); } return (byte) i; }
public T get() { if ( !initialized ) { throw new AssertionFailure( "A reference has been accessed before having been initialized." ); } return value; }
@Override public void raiseExceptionOnTimeout() { if ( this.type == Type.LIMIT ) { throw new SearchException( "Cannot define both setTimeout and limitFetchingTime on a full-text query. Please report your need to the Hibernate team" ); } this.type = Type.EXCEPTION; }
void initialize(T value) { if ( this.value != null ) { throw new AssertionFailure( "A reference has been initialized more than once." ); } this.value = value; this.initialized = true; }
@Override public void limitFetchingOnTimeout() { if ( this.type == Type.EXCEPTION ) { throw new SearchException( "Cannot define both setTimeout and limitFetchingTime on a full-text query. Please report your need to the Hibernate team" ); } this.type = Type.LIMIT; }
public static boolean cacheInstance(FilterCacheModeType type) { switch ( type ) { case NONE: return false; case INSTANCE_AND_DOCIDSETRESULTS: return true; case INSTANCE_ONLY: return true; default: throw new AssertionFailure( "Unknown FilterCacheModeType:" + type ); } }
private void checkNotCompressed(final String fieldName) { //TODO this sanity check should be done at bootstrap, not runtime if ( storeType == Store.COMPRESS ) { throw new SearchException( "Error indexing field " + fieldName + ", @NumericField cannot be compressed" ); } }
private JsonObject requireRoot(JsonObject root) { if ( root == null ) { throw new AssertionFailure( "A null root was encountered" ); } else { return root; } } }
private static void validateMappingFactoryDefinition(int count, Class<?> factory) { if ( count == 0 ) { throw new SearchException( "No @Factory method defined for building programmatic api on " + factory ); } if ( count > 1 ) { throw new SearchException( "Multiple @Factory methods defined. Only one factory method required. " + factory ); } }
private JsonObject requireRoot(JsonObject root) { if ( root == null ) { throw new AssertionFailure( "A null root was encountered" ); } else { return root; } } }
@Override public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { throw new SearchException( "This sort field should never have been executed in the first place." + " This is probably a result of queryBuilder.sort().byNative(String) being called while using the Lucene backend." + " This method is only provided for use with the Elasticsearch backend." ); } };
@Override public void checkSuccess(JsonObject bulkResponseItem) { throw new AssertionFailure( "This method should never be called, because DeleteByQuery actions are not Bulkable" ); } }
@Override public void limitFetchingOnTimeout() { if ( this.type == Type.EXCEPTION ) { throw new SearchException( "Cannot define both setTimeout and limitFetchingTime on a full-text query. Please report your need to the Hibernate team" ); } this.type = Type.LIMIT; }
void initialize(T value) { if ( this.value != null ) { throw new AssertionFailure( "A reference has been initialized more than once." ); } this.value = value; this.initialized = true; }
public static void verifyItsAReadOnlySegmentReader(IndexReader reader) { if ( ! ( reader instanceof SegmentReader ) ) { throw new SearchException( "test failed: we should receive subreaders" ); } }
@Override public void performWork(LuceneWork work, IndexWriterDelegate delegate, IndexingMonitor monitor) { throw new SearchException( "failed work message" ); } }
public static void assertInstancesCreated(int count) { if ( creationCount != count ) { throw new SearchException( "test failed, " + creationCount + " instances were created, expected " + count ); } } }
public static void assertConstructorInvoked(int times) { if ( constructorCount != times ) { throw new SearchException( "test failed, constructor invoked " + constructorCount + ", expected " + times ); } }