Returns True if partition is already indexed. Otherwise returns False.
178391
def is_indexed(self, partition):
        
        query = text("""
            SELECT vid
            FROM partition_index
            WHERE vid = :vid;
        """)
        result = self.execute(query, vid=partition.vid)
        return bool(result.fetchall())
310734
public boolean isExistsIndex(String indexName) {
        IndicesExistsResponse response =
                getClient().admin().indices().exists(
                        new IndicesExistsRequest().indices(new String[]{indexName})).actionGet();
        return response.isExists();
    }
1021417
def same_partial_index(self, other):
        
        if (
            self.has_option("where")
            and other.has_option("where")
            and self.get_option("where") == other.get_option("where")
        ):
            return True

        if not self.has_option("where") and not other.has_option("where"):
            return True

        return False
228641
def HasIndex(self, index):
        
        for i in self.Items:
            if i.index == index:
                return True
        return False
921063
@Override
    public boolean has(int index, Scriptable start)
    {
        if (externalData != null) {
            return (index < externalData.getArrayLength());
        }
        return null != slotMap.query(null, index);
    }
928345
def exists(self, index):
        
        data = self.data
        try:
            for c in self._split(index):
                i = int(c) - 1
                data = data[i][4]
        except Exception:
            return False
        return True
1278640
public boolean isUseSecondryIndex()
    {
        // if lucene directory and indexer class both not present then return
        // true.

        return StringUtils.isEmpty(LuceneIndexDir) && StringUtils.isBlank(LuceneIndexDir)
                && StringUtils.isEmpty(indexImplementor) && StringUtils.isBlank(indexImplementor);
    }
667081
boolean isCompactionRequired(SegmentProperties info) {
        long startOffset = getCompactionStartOffset(info);
        long lastIndexOffset = this.indexReader.getLastIndexedOffset(info);
        if (startOffset + this.connector.getMaxCompactionSize() >= lastIndexOffset) {
            // Either:
            // 1. Nothing was indexed
            // 2. Compaction has already reached the indexed limit.
            // 3. Not enough "uncompacted" data - at least this.maxCompactLength must be accumulated to trigger a compaction.
            return false;
        }

        long totalEntryCount = this.indexReader.getTotalEntryCount(info);
        long entryCount = this.indexReader.getEntryCount(info);
        long utilization = totalEntryCount == 0 ? 100 : MathHelpers.minMax(Math.round(100.0 * entryCount / totalEntryCount), 0, 100);
        long utilizationThreshold = (int) MathHelpers.minMax(this.indexReader.getCompactionUtilizationThreshold(info), 0, 100);
        return utilization < utilizationThreshold;
    }
737593
def status(self):
        """"""
        if all(os.path.exists(p.path) for p in self.parts): return 'splitted'
        return False
873448
@Override
	public boolean isStored() {

		if (isIdProperty()) {
			return true;
		}

		Indexed indexedAnnotation = getIndexAnnotation();
		return indexedAnnotation != null && indexedAnnotation.stored();
	}
274231
public boolean contains(long index) {
    assertSegmentOpen();

    if (!validIndex(index))
      return false;

    // Check the memory index first for performance reasons.
    long offset = relativeOffset(index);
    return offsetIndex.contains(offset);
  }
145496
public boolean existsMapping(String indexName, String mappingName) {
        ClusterStateResponse resp = this.client.admin().cluster().prepareState().execute().actionGet();

        if (resp.getState().getMetaData().index(indexName) == null) {
            return false;
        }
        ImmutableOpenMap<String, MappingMetaData> mappings = resp.getState().getMetaData().index(indexName).getMappings();

        if (mappings.get(mappingName) != null) {
            return true;
        }
        return false;
    }
663784
def set_indexing(working_dir, flag):
    
    indexing_path = get_indexing_lockfile(working_dir)
    if flag:
        try:
            fd = open( indexing_path, "w+" )
            fd.close()
            return True
        except:
            return False

    else:
        try:
            os.unlink( indexing_path )
            return True
        except:
            return False
1048237
private Boolean indexExists(String labelName, List<String> propertyNames) {
        Schema schema = db.schema();

        for (IndexDefinition indexDefinition : Iterables.asList(schema.getIndexes(Label.label(labelName)))) {
            List<String> properties = Iterables.asList(indexDefinition.getPropertyKeys());

            if (properties.equals(propertyNames)) {
                return true;
            }
        }

        return false;
    }
939463
public boolean verifyIndexes() {
    if (!isPrefixFreeCode(this.forwardIndex.keySet())) {
      return false;
    }
    for (final Entry<Bits, T> e : this.forwardIndex.entrySet()) {
      if (!e.getKey().equals(this.reverseIndex.get(e.getValue()))) {
        return false;
      }
      if (!e.getValue().equals(this.forwardIndex.get(e.getKey()))) {
        return false;
      }
    }
    for (final Entry<T, Bits> e : this.reverseIndex.entrySet()) {
      if (!e.getKey().equals(this.forwardIndex.get(e.getValue()))) {
        return false;
      }
      if (!e.getValue().equals(this.reverseIndex.get(e.getKey()))) {
        return false;
      }
    }
    return this.reverseIndex.size() == this.forwardIndex.size();
  }
110564
private boolean recoveryIndexFromCoordinator() throws IOException
   {
      File indexDirectory = new File(handler.getContext().getIndexDirectory());

      try
      {
         IndexRecovery indexRecovery = handler.getContext().getIndexRecovery();
         // check if index not ready
         if (!indexRecovery.checkIndexReady())
         {
            return false;
         }
         //Switch index offline
         indexRecovery.setIndexOffline();

         for (String filePath : indexRecovery.getIndexList())
         {
            File indexFile = new File(indexDirectory, filePath);
            if (!PrivilegedFileHelper.exists(indexFile.getParentFile()))
            {
               PrivilegedFileHelper.mkdirs(indexFile.getParentFile());
            }

            // transfer file 
            InputStream in = indexRecovery.getIndexFile(filePath);
            OutputStream out = PrivilegedFileHelper.fileOutputStream(indexFile);
            try
            {
               DirectoryHelper.transfer(in, out);
            }
            finally
            {
               DirectoryHelper.safeClose(in);
               DirectoryHelper.safeClose(out);
            }
         }
         //Switch index online
         indexRecovery.setIndexOnline();

         return true;
      }
      catch (RepositoryException e)
      {
         LOG.error("Cannot retrieve the indexes from the coordinator, the indexes will then be created from indexing",
            e);
      }
      catch (IOException e)
      {
         LOG.error("Cannot retrieve the indexes from the coordinator, the indexes will then be created from indexing",
            e);
      }

      LOG.info("Clean up index directory " + indexDirectory.getAbsolutePath());
      DirectoryHelper.removeDirectory(indexDirectory);

      return false;
   }
366263
def _is_partial_index(gbi_file):
    
    with open(gbi_file) as in_handle:
        for i, _ in enumerate(in_handle):
            if i > 2:
                return False
    return True