Examples of seekToFirst()


Examples of org.fusesource.leveldbjni.internal.JniKeyDBIterator.seekToFirst()

    }

    @Override
    public CloseableIterator<Long> keyIterator() {
        final JniKeyDBIterator iterator = ((JniDB) db).keyIterator(new ReadOptions());
        iterator.seekToFirst();
        return new CloseableIterator<Long>() {

            @Override
            public boolean hasNext() {
                return iterator.hasNext();
View Full Code Here

Examples of org.iq80.leveldb.DBIterator.seekToFirst()

            throw new PersistenceException("LevelDB is stopped");
         }
         DBIterator it = db.iterator(new ReadOptions().fillCache(false));
         if (configuration.clearThreshold() <= 0) {
            try {
               for (it.seekToFirst(); it.hasNext(); ) {
                  Map.Entry<byte[], byte[]> entry = it.next();
                  db.delete(entry.getKey());
                  count++;

                  if (count > configuration.clearThreshold()) {
View Full Code Here

Examples of org.iq80.leveldb.DBIterator.seekToFirst()

         if (stopped) {
            throw new PersistenceException("LevelDB is stopped");
         }
         DBIterator it = db.iterator(new ReadOptions().fillCache(false));
         try {
            for (it.seekToFirst(); it.hasNext(); ) {
               Map.Entry<byte[], byte[]> entry = it.next();
               entries.add(entry);
               if (entries.size() == batchSize) {
                  final List<Map.Entry<byte[], byte[]>> batch = entries;
                  entries = new ArrayList<Map.Entry<byte[], byte[]>>(batchSize);
View Full Code Here

Examples of org.iq80.leveldb.DBIterator.seekToFirst()

         List<Long> times = new ArrayList<Long>();
         List<Object> keys = new ArrayList<Object>();
         DBIterator it = expiredDb.iterator(new ReadOptions().fillCache(false));
         long now = ctx.getTimeService().wallClockTime();
         try {
            for (it.seekToFirst(); it.hasNext();) {
               Map.Entry<byte[], byte[]> entry = it.next();

               Long time = (Long) unmarshall(entry.getKey());
               if (time > now)
                  break;
View Full Code Here

Examples of org.iq80.leveldb.DBIterator.seekToFirst()

      DBIterator it = db.iterator(new ReadOptions().fillCache(false));
      boolean destroyDatabase = false;

      if (configuration.clearThreshold() <= 0) {
         try {
            for (it.seekToFirst(); it.hasNext();) {
               Map.Entry<byte[], byte[]> entry = it.next();
               db.delete(entry.getKey());
               count++;

               if (count > configuration.clearThreshold()) {
View Full Code Here

Examples of org.iq80.leveldb.DBIterator.seekToFirst()

      final TaskContext taskContext = new TaskContextImpl();

      List<Map.Entry<byte[], byte[]>> entries = new ArrayList<Map.Entry<byte[], byte[]>>(batchSize);
      DBIterator it = db.iterator(new ReadOptions().fillCache(false));
      try {
         for (it.seekToFirst(); it.hasNext();) {
            Map.Entry<byte[], byte[]> entry = it.next();
            entries.add(entry);
            if (entries.size() == batchSize) {
               final List<Map.Entry<byte[], byte[]>> batch = entries;
               entries = new ArrayList<Map.Entry<byte[], byte[]>>(batchSize);
View Full Code Here

Examples of org.iq80.leveldb.DBIterator.seekToFirst()

         List<Long> times = new ArrayList<Long>();
         List<Object> keys = new ArrayList<Object>();
         DBIterator it = expiredDb.iterator(new ReadOptions().fillCache(false));
         try {
            for (it.seekToFirst(); it.hasNext();) {
               Map.Entry<byte[], byte[]> entry = it.next();

               Long time = (Long) unmarshall(entry.getKey());
               if (time > System.currentTimeMillis())
                  break;
View Full Code Here

Examples of org.iq80.leveldb.DBIterator.seekToFirst()

      DBIterator it = db.iterator(new ReadOptions().fillCache(false));
      boolean destroyDatabase = false;

      if (configuration.clearThreshold() <= 0) {
         try {
            for (it.seekToFirst(); it.hasNext();) {
               Map.Entry<byte[], byte[]> entry = it.next();
               db.delete(entry.getKey());
               count++;

               if (count > configuration.clearThreshold()) {
View Full Code Here

Examples of org.iq80.leveldb.DBIterator.seekToFirst()

      final TaskContext taskContext = new TaskContextImpl();

      List<Map.Entry<byte[], byte[]>> entries = new ArrayList<Map.Entry<byte[], byte[]>>(batchSize);
      DBIterator it = db.iterator(new ReadOptions().fillCache(false));
      try {
         for (it.seekToFirst(); it.hasNext();) {
            Map.Entry<byte[], byte[]> entry = it.next();
            entries.add(entry);
            if (entries.size() == batchSize) {
               final List<Map.Entry<byte[], byte[]>> batch = entries;
               entries = new ArrayList<Map.Entry<byte[], byte[]>>(batchSize);
View Full Code Here

Examples of org.iq80.leveldb.DBIterator.seekToFirst()

         List<Long> times = new ArrayList<Long>();
         List<Object> keys = new ArrayList<Object>();
         DBIterator it = expiredDb.iterator(new ReadOptions().fillCache(false));
         try {
            for (it.seekToFirst(); it.hasNext();) {
               Map.Entry<byte[], byte[]> entry = it.next();

               Long time = (Long) unmarshall(entry.getKey());
               if (time > System.currentTimeMillis())
                  break;
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.