Examples of LocalCache


Examples of org.apache.drill.exec.cache.LocalCache

    cache.close();
    coordinator.close();
  }

  public static RemoteServiceSet getLocalServiceSet(){
    return new RemoteServiceSet(new LocalCache(), new LocalClusterCoordinator());
  }
View Full Code Here

Examples of org.apache.drill.exec.cache.local.LocalCache

  }

  protected void testSqlPlan(String sqlCommands) throws Exception{
    String[] sqlStrings = sqlCommands.split(";");

    final DistributedCache cache = new LocalCache();
    cache.run();

    final LocalPStoreProvider provider = new LocalPStoreProvider(config);
    provider.start();

    final SystemOptionManager opt = new SystemOptionManager(config, provider);
View Full Code Here

Examples of org.apache.drill.exec.cache.local.LocalCache

    }
    coordinator.close();
  }

  public static RemoteServiceSet getLocalServiceSet(){
    return new RemoteServiceSet(new LocalCache(), new LocalClusterCoordinator());
  }
View Full Code Here

Examples of org.apache.drill.exec.cache.local.LocalCache

  }

  protected void testSqlPlan(String sqlCommands) throws Exception{
    String[] sqlStrings = sqlCommands.split(";");

    final DistributedCache cache = new LocalCache();
    cache.run();

    final LocalPStoreProvider provider = new LocalPStoreProvider(config);
    provider.start();

    final SystemOptionManager systemOptions = new SystemOptionManager(config, provider);
View Full Code Here

Examples of org.apache.drill.exec.cache.local.LocalCache

   * @throws Exception
   */
  private void compilationInnerClass(QueryClassLoader loader) throws Exception{
    CodeGenerator<ExampleInner> cg = newCodeGenerator(ExampleInner.class, ExampleTemplateWithInner.class);

    ClassTransformer ct = new ClassTransformer(new LocalCache());
    Class<? extends ExampleInner> c = (Class<? extends ExampleInner>) ct.getImplementationClass(loader, cg.getDefinition(), cg.generateAndGet(), cg.getMaterializedClassName());
    ExampleInner t = (ExampleInner) c.newInstance();
    t.doOutside();
    t.doInsideOutside();
  }
View Full Code Here

Examples of org.apache.drill.exec.cache.local.LocalCache

    }

  }

  public static CodeCompiler getTestCompiler(DrillConfig c) throws IOException{
    return new CodeCompiler(c, new LocalCache(), new SystemOptionManager(c, new LocalPStoreProvider(c)).init());
  }
View Full Code Here

Examples of org.apache.jackrabbit.aws.ext.LocalCache

            } else {
                LOG.info("marker file = " + markerFile.getAbsolutePath()
                    + " exists");
            }
        }
        cache = new LocalCache(path, tmpDir.getAbsolutePath(), cacheSize,
            cachePurgeTrigFactor, cachePurgeResizeFactor);
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.data.LocalCache

    /**
     * Test to validate store retrieve in cache.
     */
    public void testStoreRetrieve() {
        try {
            LocalCache cache = new LocalCache(CACHE_DIR, TEMP_DIR, 400, 0.95,
                0.70);
            Random random = new Random(12345);
            byte[] data = new byte[100];
            Map<String, byte[]> byteMap = new HashMap<String, byte[]>();
            random.nextBytes(data);
            byteMap.put("a1", data);

            data = new byte[100];
            random.nextBytes(data);
            byteMap.put("a2", data);

            data = new byte[100];
            random.nextBytes(data);
            byteMap.put("a3", data);

            cache.store("a1", new ByteArrayInputStream(byteMap.get("a1")));
            cache.store("a2", new ByteArrayInputStream(byteMap.get("a2")));
            cache.store("a3", new ByteArrayInputStream(byteMap.get("a3")));
            assertEquals(new ByteArrayInputStream(byteMap.get("a1")),
                cache.getIfStored("a1"));
            assertEquals(new ByteArrayInputStream(byteMap.get("a2")),
                cache.getIfStored("a2"));
            assertEquals(new ByteArrayInputStream(byteMap.get("a3")),
                cache.getIfStored("a3"));
        } catch (Exception e) {
            LOG.error("error:", e);
            fail();
        }

View Full Code Here

Examples of org.apache.jackrabbit.core.data.LocalCache

     * cachePurgeTrigFactor * size.
     */
    public void testAutoPurge() {
        try {

            LocalCache cache = new LocalCache(CACHE_DIR, TEMP_DIR, 400, 0.95,
                0.70);
            Random random = new Random(12345);
            byte[] data = new byte[100];
            Map<String, byte[]> byteMap = new HashMap<String, byte[]>();
            random.nextBytes(data);
            byteMap.put("a1", data);

            data = new byte[100];
            random.nextBytes(data);
            byteMap.put("a2", data);

            data = new byte[100];
            random.nextBytes(data);
            byteMap.put("a3", data);

            data = new byte[100];
            random.nextBytes(data);
            byteMap.put("a4", data);

            cache.store("a1", new ByteArrayInputStream(byteMap.get("a1")));
            cache.store("a2", new ByteArrayInputStream(byteMap.get("a2")));
            cache.store("a3", new ByteArrayInputStream(byteMap.get("a3")));
            assertEquals(new ByteArrayInputStream(byteMap.get("a1")),
                cache.getIfStored("a1"));
            assertEquals(new ByteArrayInputStream(byteMap.get("a2")),
                cache.getIfStored("a2"));
            assertEquals(new ByteArrayInputStream(byteMap.get("a3")),
                cache.getIfStored("a3"));

            data = new byte[90];
            random.nextBytes(data);
            byteMap.put("a4", data);
            // storing a4 should purge cache
            cache.store("a4", new ByteArrayInputStream(byteMap.get("a4")));
            Thread.sleep(1000);

            assertNull("a1 should be null", cache.getIfStored("a1"));
            assertNull("a2 should be null", cache.getIfStored("a2"));
            assertEquals(new ByteArrayInputStream(byteMap.get("a3")),
                cache.getIfStored("a3"));
            assertEquals(new ByteArrayInputStream(byteMap.get("a4")),
                cache.getIfStored("a4"));
            data = new byte[100];
            random.nextBytes(data);
            byteMap.put("a5", data);
            cache.store("a5", new ByteArrayInputStream(byteMap.get("a5")));
            assertEquals(new ByteArrayInputStream(byteMap.get("a3")),
                cache.getIfStored("a3"));
        } catch (Exception e) {
            LOG.error("error:", e);
            fail();
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.data.LocalCache

    public void testStoreRetrieve() {
        try {
            AsyncUploadCache pendingFiles = new AsyncUploadCache();
            pendingFiles.init(TARGET_DIR, CACHE_DIR, 100);
            pendingFiles.reset();
            LocalCache cache = new LocalCache(CACHE_DIR, TEMP_DIR, 400, 0.95,
                0.70, pendingFiles);
            Random random = new Random(12345);
            byte[] data = new byte[100];
            Map<String, byte[]> byteMap = new HashMap<String, byte[]>();
            random.nextBytes(data);
            byteMap.put("a1", data);

            data = new byte[100];
            random.nextBytes(data);
            byteMap.put("a2", data);

            data = new byte[100];
            random.nextBytes(data);
            byteMap.put("a3", data);

            cache.store("a1", new ByteArrayInputStream(byteMap.get("a1")));
            cache.store("a2", new ByteArrayInputStream(byteMap.get("a2")));
            cache.store("a3", new ByteArrayInputStream(byteMap.get("a3")));
            assertEquals(new ByteArrayInputStream(byteMap.get("a1")),
                cache.getIfStored("a1"));
            assertEquals(new ByteArrayInputStream(byteMap.get("a2")),
                cache.getIfStored("a2"));
            assertEquals(new ByteArrayInputStream(byteMap.get("a3")),
                cache.getIfStored("a3"));
        } catch (Exception e) {
            LOG.error("error:", e);
            fail();
        }
    }
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.