Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.WindowCacheConfig.install()


    final WindowCacheConfig c = new WindowCacheConfig();
    c.setPackedGitLimit(128 * WindowCacheConfig.KB);
    c.setPackedGitWindowSize(8 * WindowCacheConfig.KB);
    c.setPackedGitMMAP(useMMAP);
    c.setDeltaBaseCacheLimit(8 * WindowCacheConfig.KB);
    c.install();
  }

  protected File getTemporaryDirectory() {
    return tmp.getAbsoluteFile();
  }
View Full Code Here


                }

                // FIXME only if windauze
                WindowCacheConfig cfg = new WindowCacheConfig();
                cfg.setPackedGitMMAP( false );
                cfg.install();

                // no git repo seems to exist, let's clone the original repo
                CredentialsProvider credentials = JGitUtils.getCredentials( (GitScmProviderRepository) repo );
                getLogger().info( "cloning [" + branch + "] to " + fileSet.getBasedir() );
                git = Git.cloneRepository().setURI( repository.getFetchUrl() ).setCredentialsProvider( credentials ).setBranch( branch ).setDirectory( fileSet.getBasedir() ).setProgressMonitor( monitor ).call();
View Full Code Here

    cfg.setPackedGitOpenFiles(settings.getFilesize(Keys.git.packedGitOpenFiles, cfg.getPackedGitOpenFiles()));
    cfg.setStreamFileThreshold(settings.getFilesize(Keys.git.streamFileThreshold, cfg.getStreamFileThreshold()));
    cfg.setPackedGitMMAP(settings.getBoolean(Keys.git.packedGitMmap, cfg.isPackedGitMMAP()));

    try {
      cfg.install();
      logger.debug(MessageFormat.format("{0} = {1,number,0}", Keys.git.packedGitWindowSize, cfg.getPackedGitWindowSize()));
      logger.debug(MessageFormat.format("{0} = {1,number,0}", Keys.git.packedGitLimit, cfg.getPackedGitLimit()));
      logger.debug(MessageFormat.format("{0} = {1,number,0}", Keys.git.deltaBaseCacheLimit, cfg.getDeltaBaseCacheLimit()));
      logger.debug(MessageFormat.format("{0} = {1,number,0}", Keys.git.packedGitOpenFiles, cfg.getPackedGitOpenFiles()));
      logger.debug(MessageFormat.format("{0} = {1,number,0}", Keys.git.streamFileThreshold, cfg.getStreamFileThreshold()));
View Full Code Here

    cfg.setDeltaBaseCacheLimit(settings.getFilesize(Keys.git.deltaBaseCacheLimit, cfg.getDeltaBaseCacheLimit()));
    cfg.setPackedGitOpenFiles(settings.getFilesize(Keys.git.packedGitOpenFiles, cfg.getPackedGitOpenFiles()));
    cfg.setPackedGitMMAP(settings.getBoolean(Keys.git.packedGitMmap, cfg.isPackedGitMMAP()));

    try {
      cfg.install();
      logger.debug(MessageFormat.format("{0} = {1,number,0}", Keys.git.packedGitWindowSize, cfg.getPackedGitWindowSize()));
      logger.debug(MessageFormat.format("{0} = {1,number,0}", Keys.git.packedGitLimit, cfg.getPackedGitLimit()));
      logger.debug(MessageFormat.format("{0} = {1,number,0}", Keys.git.deltaBaseCacheLimit, cfg.getDeltaBaseCacheLimit()));
      logger.debug(MessageFormat.format("{0} = {1,number,0}", Keys.git.packedGitOpenFiles, cfg.getPackedGitOpenFiles()));
      logger.debug(MessageFormat.format("{0} = {1}", Keys.git.packedGitMmap, cfg.isPackedGitMMAP()));
View Full Code Here

  public void setUp() throws Exception {
    super.setUp();

    WindowCacheConfig cfg = new WindowCacheConfig();
    cfg.setStreamFileThreshold(streamThreshold);
    cfg.install();

    repo = createBareRepository();
    wc = (WindowCursor) repo.newObjectReader();
  }
View Full Code Here

    final WindowCacheConfig c = new WindowCacheConfig();
    c.setPackedGitLimit(128 * WindowCacheConfig.KB);
    c.setPackedGitWindowSize(8 * WindowCacheConfig.KB);
    c.setPackedGitMMAP(useMMAP);
    c.setDeltaBaseCacheLimit(8 * WindowCacheConfig.KB);
    c.install();
  }

  protected File getTemporaryDirectory() {
    return tmp.getAbsoluteFile();
  }
View Full Code Here

  public void setUp() throws Exception {
    super.setUp();

    WindowCacheConfig cfg = new WindowCacheConfig();
    cfg.setStreamFileThreshold(streamThreshold);
    cfg.install();

    repo = createBareRepository();
    tr = new TestRepository<Repository>(repo);
    wc = (WindowCursor) repo.newObjectReader();
  }
View Full Code Here

  }

  @Test
  public void testCache_Defaults() throws IOException {
    WindowCacheConfig cfg = new WindowCacheConfig();
    cfg.install();
    doCacheTests();
    checkLimits(cfg);

    final WindowCache cache = WindowCache.getInstance();
    assertEquals(6, cache.getOpenFiles());
View Full Code Here

  @Test
  public void testCache_TooFewFiles() throws IOException {
    final WindowCacheConfig cfg = new WindowCacheConfig();
    cfg.setPackedGitOpenFiles(2);
    cfg.install();
    doCacheTests();
    checkLimits(cfg);
  }

  @Test
View Full Code Here

  @Test
  public void testCache_TooSmallLimit() throws IOException {
    final WindowCacheConfig cfg = new WindowCacheConfig();
    cfg.setPackedGitWindowSize(4096);
    cfg.setPackedGitLimit(4096);
    cfg.install();
    doCacheTests();
    checkLimits(cfg);
  }

  private static void checkLimits(final WindowCacheConfig cfg) {
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.