Examples of IndexCollection


Examples of com.impetus.kundera.index.IndexCollection

        {
            metadata.setIndexName(clazz.getSimpleName());
        }
        Index idx = clazz.getAnnotation(Index.class);

        IndexCollection indexes = clazz.getAnnotation(IndexCollection.class);

        EntityType entityType = (EntityType) kunderaMetadata.getApplicationMetadata()
                .getMetaModelBuilder(metadata.getPersistenceUnit()).getManagedTypes().get(clazz);

        List<String> columnsNameToBeIndexed = new ArrayList<String>();

        Map<String, com.impetus.kundera.index.Index> indexedColumnsMap = new HashMap<String, com.impetus.kundera.index.Index>();

        if (null != indexes)
        {
            if (indexes.columns() != null && indexes.columns().length != 0)
            {
                metadata.setIndexable(true);
                for (com.impetus.kundera.index.Index indexedColumn : indexes.columns())
                {
                    if (indexedColumn.type().equals("composite"))
                    {
                        // means comma seperated list of columns
                        metadata.addIndexProperty(
View Full Code Here

Examples of com.impetus.kundera.index.IndexCollection

     */
    public static Map<String, PropertyIndex> getIndexesOnEmbeddable(Class<?> entityClazz)
    {
        Map<String, PropertyIndex> pis = new HashMap<String, PropertyIndex>();
        Index idx = entityClazz.getAnnotation(Index.class);
        IndexCollection indexes = entityClazz.getAnnotation(IndexCollection.class);
        List<String> columnsNameToBeIndexed = null;
        Map<String, com.impetus.kundera.index.Index> columnsToBeIndexed = null;
        if (null != indexes)
        {
            columnsToBeIndexed = new HashMap<String, com.impetus.kundera.index.Index>();
            if (indexes.columns() != null && indexes.columns().length != 0)
            {
                for (com.impetus.kundera.index.Index indexedColumn : indexes.columns())
                {
                    columnsToBeIndexed.put(indexedColumn.name(), indexedColumn);
                }
            }
        }
View Full Code Here

Examples of com.impetus.kundera.index.IndexCollection

    public static boolean isEmbeddedAtributeIndexable(Field embeddedField)
    {
        Class<?> embeddableClass = PropertyAccessorHelper.getGenericClass(embeddedField);
        Index indexAnn = embeddableClass.getAnnotation(Index.class);
        IndexCollection indexCollection = embeddableClass.getAnnotation(IndexCollection.class);
        if (indexCollection != null && indexCollection.columns() != null)
        {
            return true;
        }
        else if (indexAnn != null)
        {
View Full Code Here

Examples of com.impetus.kundera.index.IndexCollection

    public static boolean isColumnInEmbeddableIndexable(Field embeddedField, String columnFieldName)
    {
        Class<?> embeddableClass = PropertyAccessorHelper.getGenericClass(embeddedField);
        Index indexAnn = embeddableClass.getAnnotation(Index.class);
        IndexCollection indexCollection = embeddableClass.getAnnotation(IndexCollection.class);
        if (indexCollection != null && indexCollection.columns() != null)
        {
            for (com.impetus.kundera.index.Index column : indexCollection.columns())
            {
                if (columnFieldName != null && column != null && column.name() != null
                        && column.name().equals(columnFieldName))
                {
                    return true;
View Full Code Here

Examples of com.splunk.IndexCollection

    }

    private void mockSplunkWriterApi() {
        try {
            Index index = mock(Index.class);
            IndexCollection indexColl = mock(IndexCollection.class);
            when(service.getIndexes()).thenReturn(indexColl);
            InputCollection inputCollection = mock(InputCollection.class);
            when(service.getInputs()).thenReturn(inputCollection);
            Input input = mock(Input.class);
            when(service.open(anyInt())).thenReturn(socket);
            when(inputCollection.get(anyString())).thenReturn(input);
            when(indexColl.get(anyString())).thenReturn(index);
            when(index.attach(isA(Args.class))).thenReturn(socket);
            when(socket.getOutputStream()).thenReturn(System.out);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of com.splunk.IndexCollection

    assertEquals(buckets, actualBuckets);
  }

  private String stubSplunkIndexColdPath(String index) {
    IndexCollection indexes = mock(IndexCollection.class);
    when(splunkService.getIndexes()).thenReturn(indexes);
    Index splunkIndex = mock(Index.class);
    when(indexes.get(index)).thenReturn(splunkIndex);
    String coldPath = "/cold/path";
    when(splunkIndex.getColdPathExpanded()).thenReturn(coldPath);
    return coldPath;
  }
View Full Code Here

Examples of com.splunk.IndexCollection

   * @return {@link Service} that returns a thawLocationPath for indexName.
   */
  public static Service createSplunkServiceReturningThawPathForIndex(
      String indexName, String thawLocationPath) {
    Service splunkService = mock(Service.class);
    IndexCollection indexesMock = mock(IndexCollection.class);
    Index indexMock = mock(Index.class);

    when(splunkService.getIndexes()).thenReturn(indexesMock);
    when(indexesMock.get(indexName)).thenReturn(indexMock);
    when(indexMock.getThawedPathExpanded()).thenReturn(thawLocationPath);
    return splunkService;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.