Package it.unimi.dsi.fastutil.longs

Examples of it.unimi.dsi.fastutil.longs.LongSet


    object.collectValueSpecifications(valueSpecifications);
    object.convertValueSpecifications(map.getIdentifiers(valueSpecifications));
  }

  public static void resolveIdentifiers(final IdentifierMap map, final IdentifierEncodedValueSpecifications object) {
    final LongSet identifiers = new LongOpenHashSet();
    object.collectIdentifiers(identifiers);
    object.convertIdentifiers(map.getValueSpecifications(identifiers));
  }
View Full Code Here


    BerkeleyDBIdentifierMap idSource = new BerkeleyDBIdentifierMap(dbEnvironment, fudgeContext);
    idSource.start();

    Map<String, Long> identifiers = new HashMap<String, Long>();
    LongSet seenIdentifiers = new LongOpenHashSet();
    for (int i = 0; i < 10; i++) {
      String valueName = "value-" + i;
      ValueSpecification valueSpec = getValueSpec(valueName);
      long identifier = idSource.getIdentifier(valueSpec);
      assertFalse(seenIdentifiers.contains(identifier));
      seenIdentifiers.add(identifier);
      identifiers.put(valueName, identifier);
    }

    for (int j = 0; j < 5; j++) {
      Long2ObjectMap<ValueSpecification> valueSpecs = idSource.getValueSpecifications(seenIdentifiers);
      assertEquals(seenIdentifiers.size(), valueSpecs.size());
      for (int i = 0; i < 10; i++) {
        String valueName = "value-" + i;
        ValueSpecification valueSpec = getValueSpec(valueName);
        long identifier = idSource.getIdentifier(valueSpec);
        long existingIdentifier = identifiers.get(valueName);
View Full Code Here

        _currentReader = reader;
        if (oldReader != null) {
          oldReader.decZoieRef();
        }
      }
      LongSet delDocs = _delDocs;
      clearDeletes();
      markDeletes(delDocs); // re-mark deletes
      commitDeletes();
    }
  }
View Full Code Here

      closeIndexWriter();
    }
  }

  public void loadFromIndex(BaseSearchIndex<R> index) throws IOException {
    LongSet delDocs = null;
    // delete docs in disk index first
    synchronized (this) {
      if (_delDocs != null && _delDocs.size() > 0) {
        delDocs = _delDocs;
        clearDeletes();
View Full Code Here

      throw new ZoieException("trying to consume to null index");
    }
    Long2ObjectMap<List<IndexingReq>> addList = new Long2ObjectOpenHashMap<List<IndexingReq>>();
    String version = idx.getVersion(); // current version

    LongSet delSet = new LongOpenHashSet();

    try {
      for (DataEvent<ZoieIndexable> evt : events) {
        if (evt == null) continue;
        version = version == null ? evt.getVersion() : (_versionComparator.compare(version,
          evt.getVersion()) < 0 ? evt.getVersion() : version);

        // interpret and get get the indexable instance
        ZoieIndexable indexable = evt.getData();
        if (indexable == null || indexable.isSkip()) continue;

        long uid = indexable.getUID();
        delSet.add(uid);
        addList.remove(uid);
        if (!(indexable.isDeleted() || evt.isDelete())) // update event
        {
          try {
            IndexingReq[] reqs = indexable.buildIndexingReqs();
View Full Code Here

   */
  @Override
  public void refresh() {
    synchronized (this) {
      try {
        LongSet delDocs = _delDocs;
        clearDeletes();
        _dispenser.getNewReader();
        markDeletes(delDocs); // re-mark deletes
        commitDeletes();
      } catch (IOException e) {
View Full Code Here

TOP

Related Classes of it.unimi.dsi.fastutil.longs.LongSet

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.