Examples of readEntries()


Examples of org.apache.bookkeeper.client.LedgerHandle.readEntries()

        writelh.addEntry(tmp.getBytes());
        long numReadable = readlh.getLastAddConfirmed();
        LOG.error("numRead " + numReadable);
        Enumeration<LedgerEntry> entries = readlh.readEntries(1, numReadable);
        try {
            readlh.readEntries(numReadable+1, numReadable+1);
            fail("Shouldn't have been able to read this far");
        } catch (BKException.BKReadException e) {
            // all is good
        }
View Full Code Here

Examples of org.apache.bookkeeper.client.LedgerHandle.readEntries()

        }

        // Should be able to read the entries from 0-9
        LedgerHandle lhs = bkc.openLedgerNoRecovery(lh.getId(),
                BookKeeper.DigestType.CRC32, "testpasswd".getBytes());
        Enumeration<LedgerEntry> entries = lhs.readEntries(0, 9);
        assertTrue("Should have the elements", entries.hasMoreElements());
        while (entries.hasMoreElements()) {
            LedgerEntry entry = entries.nextElement();
            assertEquals("testBuiltAutoRecovery", new String(entry.getEntry()));
        }
View Full Code Here

Examples of org.apache.bookkeeper.client.LedgerHandle.readEntries()

                long starttime = System.nanoTime();

                while (lastRead < lastConfirmed) {
                    long nextLimit = lastRead + 100000;
                    long readTo = Math.min(nextLimit, lastConfirmed);
                    Enumeration<LedgerEntry> entries = lh.readEntries(lastRead+1, readTo);
                    lastRead = readTo;
                    while (entries.hasMoreElements()) {
                        LedgerEntry e = entries.nextElement();
                        entriesRead++;
                        if ((entriesRead % 10000) == 0) {
View Full Code Here

Examples of org.apache.bookkeeper.client.LedgerHandle.readEntries()

        return lhs;
    }

    private void verifyLedger(long lid, long startEntryId, long endEntryId) throws Exception {
        LedgerHandle lh = bkc.openLedger(lid, digestType, "".getBytes());
        Enumeration<LedgerEntry> entries = lh.readEntries(startEntryId, endEntryId);
        while (entries.hasMoreElements()) {
            LedgerEntry entry = entries.nextElement();
            assertEquals(msg, new String(entry.getEntry()));
        }
    }
View Full Code Here

Examples of org.apache.bookkeeper.metastore.MetastoreCursor.readEntries()

                    if (!cursor.hasMoreEntries()) {
                        return false;
                    }

                    try {
                        itemIter = cursor.readEntries(cfg.getMetastoreMaxEntriesPerScan());
                    } catch (MSException mse) {
                        logger.warn("Interrupted when iterating the topics list : ", mse);
                        return false;
                    }
                }
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.routing.PrefixSource.readEntries()

  protected void buildPathMatcherFor(final MavenProxyRepository mavenProxyRepository) {
    try {
      final PrefixSource prefixSource = manager.getPrefixSourceFor(mavenProxyRepository);
      if (prefixSource.supported()) {
        final PathMatcher pathMatcher = new PathMatcher(prefixSource.readEntries(), Integer.MAX_VALUE);
        pathMatchers.put(mavenProxyRepository.getId(), pathMatcher);
      }
      else {
        dropPathMatcherFor(mavenProxyRepository);
      }
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.routing.PrefixSource.readEntries()

          // grab local too and merge them
          final DiscoveryResult<MavenRepository> localDiscoveryResult =
              localContentDiscoverer.discoverLocalContent(mavenProxyRepository);
          if (localDiscoveryResult.isSuccessful()) {
            final HashSet<String> mergedEntries = Sets.newHashSet();
            mergedEntries.addAll(remotePrefixSource.readEntries());
            mergedEntries.addAll(localDiscoveryResult.getPrefixSource().readEntries());
            final ArrayListPrefixSource mergedPrefixSource =
                new ArrayListPrefixSource(Lists.newArrayList(mergedEntries),
                    remotePrefixSource.getLostModifiedTimestamp());
            prefixSource = mergedPrefixSource;
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.routing.PrefixSource.readEntries()

          wm.getPrefixSourceFor(getRepositoryRegistry().getRepositoryWithFacet(GROUP1_REPO_ID,
              MavenRepository.class));

      assertThat("Group1 should have WL", groupPrefixSource.supported());

      final List<String> groupEntries = groupPrefixSource.readEntries();
      assertThat(groupEntries, hasSize(1));
      assertThat(groupEntries, hasItem("/org/apache"));
    }
    // after member addition and removal (from member group1), group2 should have proxy1 and proxt3 WL in group
    {
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.routing.PrefixSource.readEntries()

          wm.getPrefixSourceFor(getRepositoryRegistry().getRepositoryWithFacet(GROUP2_REPO_ID,
              MavenRepository.class));

      assertThat("Group2 should have WL", groupPrefixSource.supported());

      final List<String> groupEntries = groupPrefixSource.readEntries();
      assertThat(groupEntries, hasSize(2));
      assertThat(groupEntries, hasItem("/org/apache"));
      assertThat(groupEntries, hasItem("/eu/flatwhite"));
    }
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.routing.PrefixSource.readEntries()

          wm.getPrefixSourceFor(getRepositoryRegistry().getRepositoryWithFacet(GROUP1_REPO_ID,
              MavenRepository.class));

      assertThat("Group1 should have WL", groupPrefixSource.supported());

      final List<String> groupEntries = groupPrefixSource.readEntries();
      assertThat(groupEntries, hasSize(4));
      assertThat(groupEntries, hasItem("/org/apache"));
      assertThat(groupEntries, hasItem("/org/sonatype"));
      assertThat(groupEntries, hasItem("/com/sonatype"));
      assertThat(groupEntries, hasItem("/eu/flatwhite"));
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.