Package org.teiid.internal.core.index

Examples of org.teiid.internal.core.index.Index


  public MetadataStore getMetadataStore(Collection<Datatype> systemDatatypes) throws IOException {
    if (this.store == null) {
      this.store = new MetadataStore();
        ArrayList<Index> tmp = new ArrayList<Index>();
      for (VirtualFile f : indexFiles) {
        Index index = new Index(f, true);
        index.setDoCache(true);
              tmp.add(index);
      }
      this.indexes = tmp.toArray(new Index[tmp.size()]);
      getAnnotationCache();
      getExtensionCache();     
      Map<String, Datatype> datatypes = getDatatypeCache();
      if (systemDatatypes != null) {
        for (Datatype datatype : systemDatatypes) {
          datatypes.put(datatype.getUUID(), datatype);
        }
      }
      List<KeyRecord> keys = findMetadataRecords(MetadataConstants.RECORD_TYPE.PRIMARY_KEY, null, false);
      for (KeyRecord keyRecord : keys) {
        this.primaryKeyCache.put(keyRecord.getUUID(), keyRecord);
      }
      getModels();
      getTables();
      getProcedures();
      //force close, since we cached the index files
      for (Index index : tmp) {
        index.close();
      }
    }
    return store;
    }
View Full Code Here


    public static Index[] getIndexes(final String indexName, Index[] indexes) {
    ArgCheck.isNotEmpty(indexName);
        // The the index file name for the record type
        final List<Index> tmp = new ArrayList<Index>(indexes.length);
        for (int i = 0; i < indexes.length; i++) {
            Index coreIndex = indexes[i];
            if(coreIndex != null) {
                final String indexFileName = indexes[i].getIndexFile().getName();
                if(indexName.equals(indexFileName)) {
                    tmp.add(coreIndex);
                }
View Full Code Here

TOP

Related Classes of org.teiid.internal.core.index.Index

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.