package net.kotek.jdbm.junk;

import net.kotek.jdbm.DB;
import net.kotek.jdbm.DBMaker;

import java.io.File;
import java.io.IOException;
import java.util.List;

/**
 * Creates huge file
 */
public class HugeData {

    static public void main(String[] args) throws IOException, InterruptedException {

        long startTime = System.currentTimeMillis();
        new File("/tmp/large/").mkdirs();
        DB db = new DBMaker("/tmp/large/db" + Math.random())
                .disableTransactions()
                .enableMRUCache()
                .build();

//        Map<Long,Integer> map = db.createHashMap("test");
        List<Long> test = db.createLinkedList("test");

        for (Long i = 1L; i < 1e10; i++) {
            if (i % 1e6 == 0) {
                System.out.println(i);
                //Thread.sleep(1000000);
            }
            test.add(i);
//            map.put(i,i.hashCode());
        }

        db.close();

        System.out.println("Finished, total time: " + (System.currentTimeMillis() - startTime) / 1000);
    }
}

@@ -152,16 +152,38 @@
 il.List;
+%0Aimport java.util.Map;
 %0A%0A/**%0A *
@@ -389,19 +389,20 @@
  File(%22/
-tmp
+hugo
 /large/%22
@@ -447,11 +447,12 @@
 r(%22/
-tmp
+hugo
 /lar
@@ -575,18 +575,16 @@
 ild();%0A%0A
-//
         
@@ -633,16 +633,18 @@
 test%22);%0A
+//
         
@@ -860,16 +860,18 @@
       %7D%0A
+//
         
@@ -887,18 +887,16 @@
 add(i);%0A
-//
         

Update some junk test