Package org.hibernate.search.exception

Examples of org.hibernate.search.exception.AssertionFailure


  @Override
  public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {
    int size = chainedFilters.size();
    if ( size == 0 ) {
      throw new AssertionFailure( "No filters to chain" );
    }
    else if ( size == 1 ) {
      return chainedFilters.get( 0 ).getDocIdSet( context, acceptDocs );
    }
    else {
View Full Code Here


  }

  private TimeoutManagerImpl getTimeoutManagerImpl() {
    if ( timeoutManager == null ) {
      if ( luceneQuery == null ) {
        throw new AssertionFailure( "Requesting TimeoutManager before setting luceneQuery()" );
      }
      timeoutManager = new TimeoutManagerImpl( luceneQuery, timeoutExceptionFactory, this.searchFactoryImplementor.getTimingSource() );
    }
    return timeoutManager;
  }
View Full Code Here

    );
    if ( analyzer == null ) {
      analyzer = typeMetadataBuilder.getAnalyzer();
    }
    if ( analyzer == null ) {
      throw new AssertionFailure( "Analyzer should not be undefined" );
    }
    typeMetadataBuilder.addToScopedAnalyzer( fieldName, analyzer, index );
  }
View Full Code Here

    typeMetadataBuilder.addClassBridgeField( fieldMetadata );

    Analyzer analyzer = typeMetadataBuilder.getAnalyzer();
    if ( analyzer == null ) {
      throw new AssertionFailure( "Analyzer should not be undefined" );
    }
  }
View Full Code Here

  @Override
  public BooleanJunction not() {
    final int lastIndex = clauses.size() - 1;
    final BooleanClause last = clauses.get( lastIndex );
    if ( ! last.getOccur().equals( BooleanClause.Occur.MUST ) ) {
      throw new AssertionFailure( "Cannot negate class: " + last.getOccur() );
    }
    clauses.set( lastIndex, new BooleanClause( last.getQuery(), BooleanClause.Occur.MUST_NOT ) );
    return this;
  }
View Full Code Here

  @Override
  public Query createQuery() {
    final int nbrOfClauses = clauses.size();
    if ( nbrOfClauses == 0 ) {
      throw new AssertionFailure( "Cannot create an empty boolean query" );
    }
    else if ( nbrOfClauses == 1 ) {
      final BooleanClause uniqueClause = clauses.get( 0 );
      if ( uniqueClause.getOccur().equals( BooleanClause.Occur.MUST_NOT ) ) {
        //FIXME We have two choices here, raise an exception or combine with an All query. #2 is done atm.
View Full Code Here

        );
        if ( analyzer == null ) {
          analyzer = typeMetadataBuilder.getAnalyzer();
        }
        if ( analyzer == null ) {
          throw new AssertionFailure( "Analyzer should not be undefined" );
        }
        typeMetadataBuilder.addToScopedAnalyzer( fieldName, analyzer, index );
      }
    }
  }
View Full Code Here

    typeMetadataBuilder.addClassBridgeField( fieldMetadata );

    Analyzer analyzer = typeMetadataBuilder.getAnalyzer();
    if ( analyzer == null ) {
      throw new AssertionFailure( "Analyzer should not be undefined" );
    }
  }
View Full Code Here

  }

  private TimeoutManagerImpl getTimeoutManagerImpl() {
    if ( timeoutManager == null ) {
      if ( luceneQuery == null ) {
        throw new AssertionFailure( "Requesting TimeoutManager before setting luceneQuery()" );
      }
      timeoutManager = new TimeoutManagerImpl( luceneQuery, timeoutExceptionFactory, this.searchFactoryImplementor.getTimingSource() );
    }
    return timeoutManager;
  }
View Full Code Here

      case PURGE_ALL:
      case INDEX:
        operation = IndexingOverride.APPLY_DEFAULT;
        break;
      default:
        throw new AssertionFailure( "Unknown work type: " + work.getType() );
    }
    Work<T> result = work;
    Class<T> entityClass = work.getEntityClass();
    switch ( operation ) {
      case APPLY_DEFAULT:
        break;
      case SKIP:
        result = null;
        log.forceSkipIndexOperationViaInterception( entityClass, work.getType() );
        break;
      case UPDATE:
        result = new Work<T>( work.getEntity(), work.getId(), WorkType.UPDATE );
        log.forceUpdateOnIndexOperationViaInterception( entityClass, work.getType() );
        break;
      case REMOVE:
        //This works because other Work constructors are never used from WorkType ADD, UPDATE, REMOVE, COLLECTION
        //TODO should we force isIdentifierRollback to false if the operation is not a delete?
        result = new Work<T>( work.getEntity(), work.getId(), WorkType.DELETE, work.isIdentifierWasRolledBack() );
        log.forceRemoveOnIndexOperationViaInterception( entityClass, work.getType() );
        break;
      default:
        throw new AssertionFailure( "Unknown action type: " + operation );
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.search.exception.AssertionFailure

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.