Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.WindowCacheConfig


  }

  @Test
  public void testConfigureCache_PackedGitWindowSize_4097() {
    try {
      final WindowCacheConfig cfg = new WindowCacheConfig();
      cfg.setPackedGitWindowSize(4097);
      cfg.install();
      fail("incorrectly permitted PackedGitWindowSize = 4097");
    } catch (IllegalArgumentException e) {
      assertEquals("Window size must be power of 2", e.getMessage());
    }
  }
View Full Code Here


  }

  @Test
  public void testConfigureCache_PackedGitOpenFiles_0() {
    try {
      final WindowCacheConfig cfg = new WindowCacheConfig();
      cfg.setPackedGitOpenFiles(0);
      cfg.install();
      fail("incorrectly permitted PackedGitOpenFiles = 0");
    } catch (IllegalArgumentException e) {
      assertEquals("Open files must be >= 1", e.getMessage());
    }
  }
View Full Code Here

  }

  @Test
  public void testConfigureCache_PackedGitWindowSizeAbovePackedGitLimit() {
    try {
      final WindowCacheConfig cfg = new WindowCacheConfig();
      cfg.setPackedGitLimit(1024);
      cfg.setPackedGitWindowSize(8192);
      cfg.install();
      fail("incorrectly permitted PackedGitWindowSize > PackedGitLimit");
    } catch (IllegalArgumentException e) {
      assertEquals("Window size must be < limit", e.getMessage());
    }
  }
View Full Code Here

    // This test is just to force coverage over some lower bounds for
    // the table. We don't want the table to wind up with too small
    // of a size. This is highly dependent upon the table allocation
    // algorithm actually implemented in WindowCache.
    //
    final WindowCacheConfig cfg = new WindowCacheConfig();
    cfg.setPackedGitLimit(6 * 4096 / 5);
    cfg.setPackedGitWindowSize(4096);
    cfg.install();
  }
View Full Code Here

    author = new PersonIdent(author, now, tz);

    committer = new PersonIdent("J. Committer", "jcommitter@example.com");
    committer = new PersonIdent(committer, now, tz);

    final WindowCacheConfig c = new WindowCacheConfig();
    c.setPackedGitLimit(128 * WindowCacheConfig.KB);
    c.setPackedGitWindowSize(8 * WindowCacheConfig.KB);
    c.setPackedGitMMAP(useMMAP);
    c.setDeltaBaseCacheLimit(8 * WindowCacheConfig.KB);
    WindowCache.reconfigure(c);
  }
 
View Full Code Here

      }

      FileBasedConfig cfg = new FileBasedConfig(configFile, FS.DETECTED);
      cfg.load();

      WindowCacheConfig wcc = new WindowCacheConfig();
      wcc.fromConfig(cfg);
      WindowCache.reconfigure(wcc);

      packConfig.fromConfig(cfg);
    }
View Full Code Here

                    // git refuses to clone otherwise
                    fileSet.getBasedir().delete();
                }

                // 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() );
                CloneCommand command = Git.cloneRepository().setURI( repository.getFetchUrl() );
View Full Code Here

     * initializing {@code Cache} used in the repository.
     */
    @Override
    public void delete() {
        repository.close();
        WindowCacheConfig config = new WindowCacheConfig();
        config.install();
        FileUtil.rm_rf(repository.getDirectory());
    }
View Full Code Here

        return revWalk.parseCommit(objectId);
    }

    public boolean move(String srcProjectOwner, String srcProjectName, String desrProjectOwner, String destProjectName) {
        repository.close();
        WindowCacheConfig config = new WindowCacheConfig();
        config.install();

        File srcGitDirectory = new File(getGitDirectory(srcProjectOwner, srcProjectName));
        File destGitDirectory = new File(getGitDirectory(desrProjectOwner, destProjectName));
        File srcGitDirectoryForMerging = new File(getDirectoryForMerging(srcProjectOwner, srcProjectName));
        File destGitDirectoryForMerging = new File(getDirectoryForMerging(desrProjectOwner, destProjectName));
View Full Code Here

  /**
   * Update the settings for the global window cache of the workspace.
   */
  public static void reconfigureWindowCache() {
    final WindowCacheConfig c = new WindowCacheConfig();
    IEclipsePreferences d = DefaultScope.INSTANCE.getNode(Activator.getPluginId());
    IEclipsePreferences p = InstanceScope.INSTANCE.getNode(Activator.getPluginId());
    c.setPackedGitLimit(p.getInt(GitCorePreferences.core_packedGitLimit, d.getInt(GitCorePreferences.core_packedGitLimit, 0)));
    c.setPackedGitWindowSize(p.getInt(GitCorePreferences.core_packedGitWindowSize, d.getInt(GitCorePreferences.core_packedGitWindowSize, 0)));
    c.setPackedGitMMAP(p.getBoolean(GitCorePreferences.core_packedGitMMAP, d.getBoolean(GitCorePreferences.core_packedGitMMAP, false)));
    c.setDeltaBaseCacheLimit(p.getInt(GitCorePreferences.core_deltaBaseCacheLimit, d.getInt(GitCorePreferences.core_deltaBaseCacheLimit, 0)));
    c.setStreamFileThreshold(p.getInt(GitCorePreferences.core_streamFileThreshold, d.getInt(GitCorePreferences.core_streamFileThreshold, 0)));
    c.install();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.storage.file.WindowCacheConfig

Copyright © 2018 www.massapicom. 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.