Examples of IndexMetaData


Examples of com.datastax.driver.core.ColumnMetadata.IndexMetadata

public class CqlIndexSpecificationAssertions {

  public static double DELTA = 1e-6; // delta for comparisons of doubles

  public static void assertIndex(IndexDescriptor expected, String keyspace, Session session) {
    IndexMetadata imd = session.getCluster().getMetadata().getKeyspace(keyspace.toLowerCase())
        .getTable(expected.getTableName().toCql()).getColumn(expected.getColumnName().toCql()).getIndex();

    assertEquals(expected.getName(), imd.getName());
  }
View Full Code Here

Examples of com.dotcms.repackage.org.elasticsearch.cluster.metadata.IndexMetaData

        Client client=new ESClient().getClient();
        Map<String,IndexMetaData> indexState=client.admin().cluster().prepareState().execute().actionGet()
                                                           .getState().getMetaData().indices();
        List<String> closeIdx=new ArrayList<String>();
        for(String idx : indexState.keySet()) {
            IndexMetaData idxM=indexState.get(idx);
            if(idxM.getState().equals(State.CLOSE))
                closeIdx.add(idx);
        }
        return closeIdx;
    }
View Full Code Here

Examples of com.liferay.portal.kernel.dao.db.IndexMetadata

                        EntityColumn col = finderColsList.get(k);

                        finderColsNames.add(col.getDBName());
                    }

                    IndexMetadata indexMetadata =
                            IndexMetadataFactoryUtil.createIndexMetadata(
                                    finder.isUnique(), entity.getTable(),
                                    finderColsNames.toArray(
                                            new String[finderColsNames.size()]));

                    indexSQLs.put(
                            indexMetadata.getSpecification(),
                            indexMetadata.getCreateSQL());

                    String finderName =
                            entity.getTable() + StringPool.PERIOD +
                                    finder.getName();

                    indexProps.put(finderName, indexMetadata.getIndexName());
                }
            }
        }

        for (Map.Entry<String, EntityMapping> entry :
View Full Code Here

Examples of com.netflix.exhibitor.core.index.IndexMetaData

                    new Function<File, Index>()
                    {
                        @Override
                        public Index apply(File f)
                        {
                            IndexMetaData   metaData;
                            try
                            {
                                metaData = indexCache.getMetaData(f);
                            }
                            catch ( Exception e )
                            {
                                context.getExhibitor().getLog().add(ActivityLog.Type.ERROR, "Loading index metadata: " + f, e);
                                metaData = new IndexMetaData(new Date(), new Date(), 0);
                            }
                            return new Index
                            (
                                f.getName(),
                                format.format(metaData.getFrom()),
                                format.format(metaData.getTo()),
                                metaData.getEntryCount()
                            );
                        }
                    }
                )
        ){};
View Full Code Here

Examples of net.sf.katta.protocol.metadata.IndexMetaData

            + INDEX_FILE.getAbsolutePath(), getNodeCount());
    protocol.addMasterOperation(deployOperation);

    TestUtil.waitUntilIndexDeployed(protocol, INDEX_NAME);
    assertEquals(1, protocol.getIndices().size());
    IndexMetaData indexMD = protocol.getIndexMD(INDEX_NAME);
    assertEquals(null, indexMD.getDeployError());
    assertEquals(SHARD_COUNT, indexMD.getShards().size());

    Set<Shard> shards = indexMD.getShards();
    for (Shard shard : shards) {
      assertEquals(getNodeCount(), protocol.getShardNodes(shard.getName()).size());
      assertEquals(1, shard.getMetaDataMap().size());
    }
View Full Code Here

Examples of net.sf.katta.protocol.metadata.IndexMetaData

    IndexDeployOperation deployOperation = new IndexDeployOperation(INDEX_NAME,
            "file://" + indexFile.getAbsolutePath(), getNodeCount());
    protocol.addMasterOperation(deployOperation);
    TestUtil.waitUntilIndexDeployed(protocol, INDEX_NAME);
    assertEquals(1, protocol.getIndices().size());
    IndexMetaData indexMD = protocol.getIndexMD(INDEX_NAME);
    assertNotNull(indexMD.getDeployError());
    assertEquals(ErrorType.SHARDS_NOT_DEPLOYABLE, indexMD.getDeployError().getErrorType());
  }
View Full Code Here

Examples of org.apache.stanbol.commons.solr.managed.IndexMetadata

     */
    public static IndexMetadata getMetadata(SolrCore core, String serverName){
        if(core == null){
            return null;
        }
        IndexMetadata metadata = new IndexMetadata();
        if(serverName != null){
            metadata.setServerName(serverName);
        }
        metadata.setSynchronized(false);
        updateMetadata(metadata, core);
        return metadata;
    }
View Full Code Here

Examples of org.datanucleus.metadata.IndexMetaData

                // Add indexes for fields of this embedded PC object
                EmbeddedPCMapping embMapping = (EmbeddedPCMapping)fieldMapping;
                for (int i=0;i<embMapping.getNumberOfJavaTypeMappings();i++)
                {
                    JavaTypeMapping embFieldMapping = embMapping.getJavaTypeMapping(i);
                    IndexMetaData imd = embFieldMapping.getMemberMetaData().getIndexMetaData();
                    if (imd != null)
                    {
                        Index index = TableUtils.getIndexForField(this, imd, embFieldMapping);
                        if (index != null)
                        {
                            indices.add(index);
                        }
                    }
                }
            }
            else if (fieldMapping instanceof SerialisedMapping)
            {
                // Don't index these
            }
            else
            {
                // Add any required index for this field
                IndexMetaData imd = fmd.getIndexMetaData();
                if (imd != null)
                {
                    // Index defined so add it
                    Index index = TableUtils.getIndexForField(this, imd, fieldMapping);
                    if (index != null)
                    {
                        indices.add(index);
                    }
                }
                else if (autoMode)
                {
                    if (fmd.getIndexed() == null)
                    {
                        // Indexing not set, so add where we think it is appropriate
                        if (!fmd.isPrimaryKey()) // Ignore PKs since they will be indexed anyway
                        {
                            int relationType = fmd.getRelationType(clr);
                            if (relationType == Relation.ONE_TO_ONE_UNI)
                            {
                                // 1-1 with FK at this side so index the FK
                                if (fieldMapping instanceof ReferenceMapping)
                                {
                                    ReferenceMapping refMapping = (ReferenceMapping)fieldMapping;
                                    if (refMapping.getMappingStrategy() == ReferenceMapping.PER_IMPLEMENTATION_MAPPING)
                                    {
                                        // Cols per implementation : index each of implementations
                                        if (refMapping.getJavaTypeMapping() != null)
                                        {
                                            int colNum = 0;
                                            JavaTypeMapping[] implMappings = refMapping.getJavaTypeMapping();
                                            for (int i=0;i<implMappings.length;i++)
                                            {
                                                int numColsInImpl = implMappings[i].getNumberOfDatastoreMappings();
                                                Index index = new Index(this, false, null);
                                                for (int j=0;j<numColsInImpl;j++)
                                                {
                                                    index.setColumn(j,
                                                        (Column)fieldMapping.getDatastoreMapping(colNum++).getDatastoreField());
                                                }
                                                indices.add(index);
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    Index index = new Index(this, false, null);
                                    for (int i=0;i<fieldMapping.getNumberOfDatastoreMappings();i++)
                                    {
                                        index.setColumn(i, (Column)fieldMapping.getDatastoreMapping(i).getDatastoreField());
                                    }
                                    indices.add(index);
                                }
                            }
                            else if (relationType == Relation.ONE_TO_ONE_BI && fmd.getMappedBy() == null)
                            {
                                // 1-1 with FK at this side so index the FK
                                Index index = new Index(this, false, null);
                                for (int i=0;i<fieldMapping.getNumberOfDatastoreMappings();i++)
                                {
                                    index.setColumn(i, (Column)fieldMapping.getDatastoreMapping(i).getDatastoreField());
                                }
                                indices.add(index);
                            }
                            else if (relationType == Relation.MANY_TO_ONE_BI)
                            {
                                // N-1 with FK at this side so index the FK
                                AbstractMemberMetaData relMmd = fmd.getRelatedMemberMetaData(clr)[0];
                                if (relMmd.getJoinMetaData() == null && fmd.getJoinMetaData() == null)
                                {
                                    Index index = new Index(this, false, null);
                                    for (int i=0;i<fieldMapping.getNumberOfDatastoreMappings();i++)
                                    {
                                        index.setColumn(i, (Column)fieldMapping.getDatastoreMapping(i).getDatastoreField());
                                    }
                                    indices.add(index);
                                }
                            }
                        }
                    }
                }
            }
        }

        // Check if any version column needs indexing
        if (versionMapping != null)
        {
            IndexMetaData idxmd = getVersionMetaData().getIndexMetaData();
            if (idxmd != null)
            {
                Index index = new Index(this, idxmd.isUnique(),
                    idxmd.getValueForExtension("extended-setting"));
                if (idxmd.getName() != null)
                {
                    index.setName(idxmd.getName());
                }
                int countVersionFields = versionMapping.getNumberOfDatastoreMappings();
                for (int i=0; i<countVersionFields; i++)
                {
                    index.addDatastoreField(versionMapping.getDatastoreMapping(i).getDatastoreField());
                }
                indices.add(index);
            }
        }

        // Check if any discriminator column needs indexing
        if (discriminatorMapping != null)
        {
            DiscriminatorMetaData dismd = getDiscriminatorMetaData();
            IndexMetaData idxmd = dismd.getIndexMetaData();
            if (idxmd != null)
            {
                Index index = new Index(this, idxmd.isUnique(),
                    idxmd.getValueForExtension("extended-setting"));
                if (idxmd.getName() != null)
                {
                    index.setName(idxmd.getName());
                }
                int countDiscrimFields = discriminatorMapping.getNumberOfDatastoreMappings();
                for (int i=0; i<countDiscrimFields; i++)
                {
                    index.addDatastoreField(discriminatorMapping.getDatastoreMapping(i).getDatastoreField());
View Full Code Here

Examples of org.datanucleus.metadata.IndexMetaData

            // Add all indices required by fields of the embedded key
            EmbeddedKeyPCMapping embMapping = (EmbeddedKeyPCMapping)keyMapping;
            for (int i=0;i<embMapping.getNumberOfJavaTypeMappings();i++)
            {
                JavaTypeMapping embFieldMapping = embMapping.getJavaTypeMapping(i);
                IndexMetaData imd = embFieldMapping.getMemberMetaData().getIndexMetaData();
                if (imd != null)
                {
                    Index index = TableUtils.getIndexForField(this, imd, embFieldMapping);
                    if (index != null)
                    {
                        indices.add(index);
                    }
                }
            }
        }

        if (valueMapping instanceof EmbeddedValuePCMapping)
        {
            // Add all indices required by fields of the embedded value
            EmbeddedValuePCMapping embMapping = (EmbeddedValuePCMapping)valueMapping;
            for (int i=0;i<embMapping.getNumberOfJavaTypeMappings();i++)
            {
                JavaTypeMapping embFieldMapping = embMapping.getJavaTypeMapping(i);
                IndexMetaData imd = embFieldMapping.getMemberMetaData().getIndexMetaData();
                if (imd != null)
                {
                    Index index = TableUtils.getIndexForField(this, imd, embFieldMapping);
                    if (index != null)
                    {
View Full Code Here

Examples of org.datanucleus.metadata.IndexMetaData

            EmbeddedElementPCMapping embMapping = (EmbeddedElementPCMapping)elementMapping;
            for (int i=0;i<embMapping.getNumberOfJavaTypeMappings();i++)
            {
                // Add indexes for fields of this embedded PC object
                JavaTypeMapping embFieldMapping = embMapping.getJavaTypeMapping(i);
                IndexMetaData imd = embFieldMapping.getMemberMetaData().getIndexMetaData();
                if (imd != null)
                {
                    Index index = TableUtils.getIndexForField(this, imd, embFieldMapping);
                    if (index != null)
                    {
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.