Examples of mark()


Examples of org.apache.cassandra.io.util.FileDataInput.mark()

                if (comparator.compare(name, indexInfo.firstName) < 0)
                   continue;
                ranges.add(indexInfo);
            }

            file.mark();
            for (IndexHelper.IndexInfo indexInfo : ranges)
            {
                file.reset();
                long curOffsert = file.skipBytes((int)indexInfo.offset);
                assert curOffsert == indexInfo.offset;
View Full Code Here

Examples of org.apache.cassandra.io.util.SequentialWriter.mark()

            SequentialWriter writer = compressed
                ? new CompressedSequentialWriter(f, filename + ".metadata", new CompressionParameters(SnappyCompressor.instance), sstableMetadataCollector)
                : new SequentialWriter(f, CompressionParameters.DEFAULT_CHUNK_LENGTH);

            writer.write("The quick ".getBytes());
            FileMark mark = writer.mark();
            writer.write("blue fox jumps over the lazy dog".getBytes());

            // write enough to be sure to change chunk
            for (int i = 0; i < junkSize; ++i)
            {
View Full Code Here

Examples of org.apache.commons.compress.compressors.pack200.Pack200CompressorInputStream.mark()

                                             m);
        try {
            // packed file is a jar, which is a zip so it starts with
            // a local file header
            assertTrue(is.markSupported());
            is.mark(5);
            assertEquals(0x50, is.read());
            byte[] rest = new byte[3];
            assertEquals(3, is.read(rest));
            assertEquals(0x4b, rest[0]);
            assertEquals(3, rest[1]);
View Full Code Here

Examples of org.apache.flume.serialization.EventDeserializer.mark()

    events = des.readEvents(10); // try to read more than we should have
    assertEquals(1, events.size());
    assertEventBodyEquals(mini, events.get(0));

    des.mark();
    des.close();
  }

  // truncation occurs at maxLineLength boundaries
  @Test
View Full Code Here

Examples of org.apache.fop.util.UnclosableInputStream.mark()

        info.mimeType = getMimeType();

        try {
            final InputStream is = new UnclosableInputStream(input);
            int length = is.available();
            is.mark(length);

            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            doc = dbf.newDocumentBuilder().parse(is);
            info.data = doc;
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataInputStream.mark()

      }

      // Now set mark() to trigger the bug
      // NOTE: in the fixed code, mark() does nothing (not supported) and
      //   hence won't trigger this bug.
      in.mark(1);
      System.out.println("MARKED");
     
      // Try to read the rest
      while (filePos < fileSize) {
        if (in.read() == -1) {
View Full Code Here

Examples of org.apache.hadoop.hdfs.util.ExactSizeInputStream.mark()

  @Test
  public void testMark() throws IOException {
    ExactSizeInputStream s = new ExactSizeInputStream(byteStream("he"), 5);
    assertFalse(s.markSupported());
    try {
      s.mark(1);
      fail("Mark should not succeed");
    } catch (UnsupportedOperationException uoe) {
      // expected
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.udf.xml.UDFXPathUtil.ReusableStringReader.mark()

      int read;
      read = reader.read(cc);
      assertEquals(6, read);
      assertEquals("Quick ", new String(cc));
     
      reader.mark(100);
     
      read = reader.read(cc);
      assertEquals(6, read);
      assertEquals("brown ", new String(cc));
     
View Full Code Here

Examples of org.apache.jackrabbit.api.management.DataStoreGarbageCollector.mark()

        // need to login to start the repository
        Session session = rep.login(new SimpleCredentials("", "".toCharArray()));

        DataStoreGarbageCollector gc = rm.createDataStoreGarbageCollector();
        try {
            gc.mark();
            gc.sweep();
        } finally {
            gc.close();
        }
View Full Code Here

Examples of org.apache.jackrabbit.core.gc.GarbageCollector.mark()

            // make sure the file is old (access time resolution is 2 seconds)
            Thread.sleep(2000);
        }

        LOG.debug("scanning...");
        gc.mark();
        int count = listIdentifiers(gc);
        LOG.debug("stop scanning; currently " + count + " identifiers");
        LOG.debug("deleting...");
        gc.getDataStore().clearInUse();
        assertTrue(gc.sweep() > 0);
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.