Examples of PersistentCache


Examples of org.apache.jackrabbit.oak.plugins.document.persistentCache.PersistentCache

                    this.documentStore = new MongoDocumentStore(db, this);
                }

                if (this.blobStore == null) {
                    GarbageCollectableBlobStore s = new MongoBlobStore(db, blobCacheSizeMB * 1024 * 1024L);
                    PersistentCache p = getPersistentCache();
                    if (p != null) {
                        s = p.wrapBlobStore(s);
                    }
                    this.blobStore = s;
                }

                if (this.diffCache == null) {
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.document.persistentCache.PersistentCache

                long maxWeight,
                DocumentNodeStore docNodeStore,
                DocumentStore docStore
                ) {
            Cache<K, V> cache = buildCache(maxWeight);
            PersistentCache p = getPersistentCache();
            if (p != null) {
                if (docNodeStore != null) {
                    docNodeStore.setPersistentCache(p);
                }
                cache = p.wrap(docNodeStore, docStore, cache, cacheType);
            }
            return cache;
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.document.persistentCache.PersistentCache

            if (persistentCacheURI == null) {
                return null;
            }
            if (persistentCache == null) {
                try {
                    persistentCache = new PersistentCache(persistentCacheURI);
                } catch (Throwable e) {
                    LOG.warn("Persistent cache not available; please disable the configuration", e);
                    throw new IllegalArgumentException(e);
                }
            }
View Full Code Here

Examples of org.gradle.cache.PersistentCache

        private <T extends Script> T loadViaCache(ClassLoader classLoader, Class<T> scriptBaseClass) {
            Map<String, Object> properties = new HashMap<String, Object>();
            properties.put("source.filename", source.getFileName());
            properties.put("source.hash", HashUtil.createHash(source.getResource().getText()));

            PersistentCache cache = cacheRepository.cache(String.format("scripts/%s", source.getClassName())).withProperties(properties).open();
            File classesDir;
            if (transformer != null) {
                String subdirName = String.format("%s_%s", transformer.getId(), scriptBaseClass.getSimpleName());
                classesDir = new File(cache.getBaseDir(), subdirName);
            } else {
                classesDir = new File(cache.getBaseDir(), scriptBaseClass.getSimpleName());
            }

            if (!cache.isValid() || !classesDir.exists()) {
                scriptCompilationHandler.compileToDir(source, classLoader, classesDir, transformer, scriptBaseClass);
                cache.markValid();
            }
            Class<? extends T> scriptClass = scriptCompilationHandler.loadFromDir(source, classLoader, classesDir,
                    scriptBaseClass);
            return scriptBaseClass.cast(ReflectionUtil.newInstance(scriptClass, new Object[0]));
        }
View Full Code Here

Examples of org.gradle.cache.PersistentCache

            return super.findClassPath(name);
        }

        synchronized (lock) {
            if (workerClassPath == null) {
                PersistentCache cache = cacheRepository.cache("workerMain").open();
                File classesDir = new File(cache.getBaseDir(), "classes");
                if (!cache.isValid()) {
                    for (Class<?> aClass : Arrays.asList(GradleWorkerMain.class, BootstrapClassLoaderWorker.class)) {
                        String fileName = aClass.getName().replace('.', '/') + ".class";
                        GFileUtils.copyURLToFile(WorkerProcessClassPathProvider.class.getClassLoader().getResource(fileName),
                                new File(classesDir, fileName));
                    }

                    cache.markValid();
                }

                workerClassPath = Collections.singleton(classesDir);
            }
            return workerClassPath;
View Full Code Here

Examples of org.gradle.cache.PersistentCache

        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put("source.filename", source.getFileName());
        properties.put("source.hash", HashUtil.createCompactMD5(source.getResource().getText()));

        String cacheName = String.format("scripts/%s/%s/%s", source.getClassName(), scriptBaseClass.getSimpleName(), transformer.getId());
        PersistentCache cache = cacheRepository.cache(cacheName)
                .withProperties(properties)
                .withValidator(validator)
                .withDisplayName(String.format("%s class cache for %s", transformer.getId(), source.getDisplayName()))
                .withInitializer(new ProgressReportingInitializer(progressLoggerFactory, new CacheInitializer(source, classLoader, transformer, verifier, scriptBaseClass)))
                .open();
View Full Code Here

Examples of org.gradle.cache.PersistentCache

        }
        LOGGER.info("================================================" + " Start building buildSrc");

        // If we were not the most recent version of Gradle to build the buildSrc dir, then do a clean build
        // Otherwise, just to a regular build
        final PersistentCache buildSrcCache = createCache(startParameter);
        try {
            GradleLauncher gradleLauncher = buildGradleLauncher(startParameter);
            try {
                return buildSrcCache.useCache("rebuild buildSrc", new BuildSrcUpdateFactory(buildSrcCache, gradleLauncher, new BuildSrcBuildListenerFactory()));
            } finally {
                gradleLauncher.stop();
            }
        } finally {
            // This isn't quite right. We should not unlock the classes until we're finished with them, and the classes may be used across multiple builds
            buildSrcCache.close();
        }
    }
View Full Code Here

Examples of org.gradle.cache.PersistentCache

            HttpResourceAccessor accessor = new HttpResourceAccessor(http);
            PluginResolutionServiceClient httpClient = startParameter.isOffline()
                    ? new OfflinePluginResolutionServiceClient()
                    : new HttpPluginResolutionServiceClient(accessor);

            PersistentCache cache = cacheRepository
                    .cache(CACHE_NAME)
                    .withDisplayName("Plugin Resolution Cache")
                    .withLockOptions(mode(FileLockManager.LockMode.None))
                    .open();
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.