org.apache.jackrabbit.core.data.DataStore.getAllIdentifiers()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中org.apache.jackrabbit.core.data.DataStore.getAllIdentifiers()方法的一些代码示例,展示了DataStore.getAllIdentifiers()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataStore.getAllIdentifiers()方法的具体详情如下:
包路径:org.apache.jackrabbit.core.data.DataStore
类名称:DataStore
方法名:getAllIdentifiers

DataStore.getAllIdentifiers介绍

[英]Get all identifiers.
[中]获取所有标识符。

代码示例

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

/**
 * Get all identifiers from the archive data store.
 * 
 * @return an iterator over all DataIdentifier objects
 * @throws DataStoreException
 *             if the list could not be read
 */
public Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException {
  return archiveDataStore.getAllIdentifiers();
}

代码示例来源:origin: org.apache.jackrabbit/oak-blob-plugins

@Override
public Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException {
  return delegate.getAllIdentifiers();
}

代码示例来源:origin: apache/jackrabbit

/**
 * Get all identifiers from the archive data store.
 * 
 * @return an iterator over all DataIdentifier objects
 * @throws DataStoreException
 *             if the list could not be read
 */
public Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException {
  return archiveDataStore.getAllIdentifiers();
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-data

/**
 * Get all identifiers from the archive data store.
 * 
 * @return an iterator over all DataIdentifier objects
 * @throws DataStoreException
 *             if the list could not be read
 */
public Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException {
  return archiveDataStore.getAllIdentifiers();
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException {
  return delegate.getAllIdentifiers();
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException {
  return delegate.getAllIdentifiers();
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException {
  return getDelegate().getAllIdentifiers();
}

代码示例来源:origin: org.apache.jackrabbit/oak-upgrade

@Override
public Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException {
  return getDelegate().getAllIdentifiers();
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public Iterator<DataRecord> getAllRecords() throws DataStoreException {
  if (delegate instanceof SharedDataStore) {
    return ((SharedDataStore) delegate).getAllRecords();
  } else {
    return Iterators.transform(delegate.getAllIdentifiers(),
      new Function<DataIdentifier, DataRecord>() {
        @Nullable
        @Override
        public DataRecord apply(@Nullable DataIdentifier input) {
          try {
            return delegate.getRecord(input);
          } catch (DataStoreException e) {
            log.warn("Error occurred while fetching DataRecord for identifier {}", input, e);
          }
          return null;
        }
    });
  }
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public Iterator<DataRecord> getAllRecords() throws DataStoreException {
  if (delegate instanceof SharedDataStore) {
    return ((SharedDataStore) delegate).getAllRecords();
  } else {
    return Iterators.transform(delegate.getAllIdentifiers(),
      new Function<DataIdentifier, DataRecord>() {
        @Nullable @Override
        public DataRecord apply(@Nullable DataIdentifier input) {
          try {
            return delegate.getRecord(input);
          } catch (DataStoreException e) {
            log.warn("Error occurred while fetching DataRecord for identifier {}", input, e);
          }
          return null;
        }
    });
  }
}

代码示例来源:origin: org.apache.jackrabbit/oak-blob-plugins

@Override
public Iterator<DataRecord> getAllRecords() throws DataStoreException {
  if (delegate instanceof SharedDataStore) {
    return ((SharedDataStore) delegate).getAllRecords();
  } else {
    return Iterators.transform(delegate.getAllIdentifiers(),
      new Function<DataIdentifier, DataRecord>() {
        @Nullable
        @Override
        public DataRecord apply(@Nullable DataIdentifier input) {
          try {
            return delegate.getRecord(input);
          } catch (DataStoreException e) {
            log.warn("Error occurred while fetching DataRecord for identifier {}", input, e);
          }
          return null;
        }
    });
  }
}

代码示例来源:origin: apache/jackrabbit

private static int listIdentifiers(GarbageCollector gc) throws DataStoreException {
  LOG.debug("identifiers:");
  int count = 0;
  Iterator<DataIdentifier> it = gc.getDataStore().getAllIdentifiers();
  while (it.hasNext()) {
    DataIdentifier id = it.next();
    LOG.debug("  " + id);
    count++;
  }
  return count;
}

代码示例来源:origin: apache/jackrabbit

private int listIdentifiers(DataStoreGarbageCollector gc) throws DataStoreException {
  DataStore ds = ((GarbageCollector) gc).getDataStore();
  Iterator<DataIdentifier> it = ds.getAllIdentifiers();
  int count = 0;
  while (it.hasNext()) {
    DataIdentifier id = it.next();
    LOG.debug("  " + id);
    count++;
  }
  return count;
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

long maxAgeMilli = 1000L * 60 * 60 * 24 * maxAge;
log.debug("Collecting all Identifiers from PrimaryDataStore...");
Iterator<DataIdentifier> allIdentifiers = primaryDataStore.getAllIdentifiers();
int moved = 0;
while (allIdentifiers.hasNext()) {

代码示例来源:origin: apache/jackrabbit

long maxAgeMilli = 1000L * 60 * 60 * 24 * maxAge;
log.debug("Collecting all Identifiers from PrimaryDataStore...");
Iterator<DataIdentifier> allIdentifiers = primaryDataStore.getAllIdentifiers();
int moved = 0;
while (allIdentifiers.hasNext()) {

代码示例来源:origin: apache/jackrabbit

private int getBinaryCount(GarbageCollector garbageCollector) {
  int count = 0;
  Iterator<DataIdentifier> it;
  try {
    it = garbageCollector.getDataStore().getAllIdentifiers();
    while (it.hasNext()) {
      it.next();
      count++;
    }
  } catch (DataStoreException e) {
    failWithException(e);
  }
  log("Binary count: " + count);
  return count;
}

代码示例来源:origin: apache/jackrabbit-oak

/**
 * Test {@link DataStore#getAllIdentifiers()} and asserts all identifiers
 * are returned.
 */
protected void doGetAllIdentifiersTest() throws Exception {
  List<DataIdentifier> list = new ArrayList<DataIdentifier>();
  Random random = randomGen;
  byte[] data = new byte[dataLength];
  random.nextBytes(data);
  DataRecord rec = ds.addRecord(new ByteArrayInputStream(data));
  list.add(rec.getIdentifier());
  data = new byte[dataLength];
  random.nextBytes(data);
  rec = ds.addRecord(new ByteArrayInputStream(data));
  list.add(rec.getIdentifier());
  data = new byte[dataLength];
  random.nextBytes(data);
  rec = ds.addRecord(new ByteArrayInputStream(data));
  list.add(rec.getIdentifier());
  Iterator<DataIdentifier> itr = Sets.newHashSet(ds.getAllIdentifiers()).iterator();
  while (itr.hasNext()) {
    assertTrue("record found on list", list.remove(itr.next()));
  }
  Assert.assertEquals(0, list.size());
}

代码示例来源:origin: apache/jackrabbit

/**
 * Test {@link DataStore#getAllIdentifiers()} and asserts all identifiers
 * are returned.
 */
protected void doGetAllIdentifiersTest() throws Exception {
  ds = createDataStore();
  List<DataIdentifier> list = new ArrayList<DataIdentifier>();
  Random random = randomGen;
  byte[] data = new byte[dataLength];
  random.nextBytes(data);
  DataRecord rec = ds.addRecord(new ByteArrayInputStream(data));
  list.add(rec.getIdentifier());
  data = new byte[dataLength];
  random.nextBytes(data);
  rec = ds.addRecord(new ByteArrayInputStream(data));
  list.add(rec.getIdentifier());
  data = new byte[dataLength];
  random.nextBytes(data);
  rec = ds.addRecord(new ByteArrayInputStream(data));
  list.add(rec.getIdentifier());
  Iterator<DataIdentifier> itr = ds.getAllIdentifiers();
  while (itr.hasNext()) {
    assertTrue("record found on list", list.remove(itr.next()));
  }
  assertEquals(0, list.size());
  ds.close();
}

代码示例来源:origin: apache/jackrabbit-oak

ds.getRecordIfStored(rec2.getIdentifier()));
Iterator<DataIdentifier> itr = ds.getAllIdentifiers();
List<DataIdentifier> list = new ArrayList<DataIdentifier>();
list.add(rec1.getIdentifier());

代码示例来源:origin: apache/jackrabbit

ds.getRecordIfStored(rec2.getIdentifier()));
Iterator<DataIdentifier> itr = ds.getAllIdentifiers();
List<DataIdentifier> list = new ArrayList<DataIdentifier>();
list.add(rec1.getIdentifier());

相关文章