本文整理汇总了Java中org.eclipse.jgit.lib.ProgressMonitor.endTask方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressMonitor.endTask方法的具体用法?Java ProgressMonitor.endTask怎么用?Java ProgressMonitor.endTask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jgit.lib.ProgressMonitor
的用法示例。
在下文中一共展示了ProgressMonitor.endTask方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: indexAll
import org.eclipse.jgit.lib.ProgressMonitor; //导入方法依赖的package包/类
@Override
public Result indexAll(ChangeIndex index) {
ProgressMonitor pm = new TextProgressMonitor();
pm.beginTask("Collecting projects", ProgressMonitor.UNKNOWN);
SortedSet<ProjectHolder> projects = new TreeSet<>();
int changeCount = 0;
Stopwatch sw = Stopwatch.createStarted();
for (Project.NameKey name : projectCache.all()) {
try (Repository repo = repoManager.openRepository(name)) {
long size = estimateSize(repo);
changeCount += size;
projects.add(new ProjectHolder(name, size));
} catch (IOException e) {
log.error("Error collecting projects", e);
return new Result(sw, false, 0, 0);
}
pm.update(1);
}
pm.endTask();
setTotalWork(changeCount);
return indexAll(index, projects);
}
示例2: migrateData
import org.eclipse.jgit.lib.ProgressMonitor; //导入方法依赖的package包/类
@Override
protected void migrateData(ReviewDb db, UpdateUI ui) throws OrmException, SQLException {
try {
try (Repository repo = repoManager.openRepository(allUsersName)) {
ProgressMonitor pm = new TextProgressMonitor();
pm.beginTask("Collecting accounts", ProgressMonitor.UNKNOWN);
Set<Account> accounts = scanAccounts(db, pm);
pm.endTask();
pm.beginTask("Migrating accounts to NoteDb", accounts.size());
for (Account account : accounts) {
updateAccountInNoteDb(repo, account);
pm.update(1);
}
pm.endTask();
}
} catch (IOException | ConfigInvalidException e) {
throw new OrmException("Migrating accounts to NoteDb failed", e);
}
}
示例3: migrateData
import org.eclipse.jgit.lib.ProgressMonitor; //导入方法依赖的package包/类
@Override
protected void migrateData(ReviewDb db, UpdateUI ui) throws OrmException {
try {
try (Repository repo = repoManager.openRepository(allUsersName)) {
ProgressMonitor pm = new TextProgressMonitor();
pm.beginTask("Removing \"My Drafts\" menu items", ProgressMonitor.UNKNOWN);
for (Account.Id id : (Iterable<Account.Id>) Accounts.readUserRefs(repo)::iterator) {
if (removeMyDrafts(repo, id)) {
pm.update(1);
}
}
pm.endTask();
}
} catch (IOException | ConfigInvalidException e) {
throw new OrmException("Removing \"My Drafts\" menu items failed", e);
}
}
示例4: doImport
import org.eclipse.jgit.lib.ProgressMonitor; //导入方法依赖的package包/类
@Override
public void doImport(ProgressMonitor progress) throws Exception {
MetaDataUpdate md = null;
try {
md = metaDataUpdateFactory.create(getProjectNameKey());
projectConfig = ProjectConfig.read(md);
progress.beginTask("Configure Gerrit project", 2);
setProjectSettings();
progress.update(1);
setProjectPermissions();
progress.update(1);
md.setMessage("Imported from " + getSourceUri());
projectConfig.commit(md);
projectCache.onCreateProject(getProjectNameKey());
} finally {
if (md != null) {
md.close();
}
progress.endTask();
}
}
示例5: run
import org.eclipse.jgit.lib.ProgressMonitor; //导入方法依赖的package包/类
@Override
public int run() throws Exception {
mustHaveValidSite();
Injector dbInjector = createDbInjector(SINGLE_USER);
manager.add(dbInjector);
manager.start();
RuntimeShutdown.add(manager::stop);
dbInjector.injectMembers(this);
ProgressMonitor progress = new TextProgressMonitor();
progress.beginTask("Importing entities", ProgressMonitor.UNKNOWN);
try (ReviewDb db = schemaFactory.open()) {
for (RelationModel model : new JavaSchemaModel(ReviewDb.class).getRelations()) {
relations.put(model.getRelationID(), Relation.create(model, db));
}
Parser<UnknownFieldSet> parser = UnknownFieldSet.getDefaultInstance().getParserForType();
try (InputStream in = new BufferedInputStream(Files.newInputStream(file.toPath()))) {
UnknownFieldSet msg;
while ((msg = parser.parseDelimitedFrom(in)) != null) {
Map.Entry<Integer, UnknownFieldSet.Field> e =
Iterables.getOnlyElement(msg.asMap().entrySet());
Relation rel =
checkNotNull(
relations.get(e.getKey()),
"unknown relation ID %s in message: %s",
e.getKey(),
msg);
List<ByteString> values = e.getValue().getLengthDelimitedList();
checkState(values.size() == 1, "expected one string field in message: %s", msg);
upsert(rel, values.get(0));
progress.update(1);
}
}
progress.endTask();
}
return 0;
}
示例6: collectProjects
import org.eclipse.jgit.lib.ProgressMonitor; //导入方法依赖的package包/类
private List<Project.NameKey> collectProjects(ProgressMonitor progress) {
progress.beginTask("Collecting projects", ProgressMonitor.UNKNOWN);
List<Project.NameKey> names = new ArrayList<>();
for (Project.NameKey nameKey : projectCache.all()) {
names.add(nameKey);
}
progress.endTask();
return names;
}
示例7: collectGroups
import org.eclipse.jgit.lib.ProgressMonitor; //导入方法依赖的package包/类
private List<AccountGroup.UUID> collectGroups(ProgressMonitor progress) throws OrmException {
progress.beginTask("Collecting groups", ProgressMonitor.UNKNOWN);
try (ReviewDb db = schemaFactory.open()) {
return groups.getAllUuids(db).collect(toImmutableList());
} finally {
progress.endTask();
}
}
示例8: collectAccounts
import org.eclipse.jgit.lib.ProgressMonitor; //导入方法依赖的package包/类
private List<Account.Id> collectAccounts(ProgressMonitor progress) throws IOException {
progress.beginTask("Collecting accounts", ProgressMonitor.UNKNOWN);
List<Account.Id> ids = new ArrayList<>();
for (Account.Id accountId : accounts.allIds()) {
ids.add(accountId);
progress.update(1);
}
progress.endTask();
return ids;
}
示例9: doImport
import org.eclipse.jgit.lib.ProgressMonitor; //导入方法依赖的package包/类
@Override
public void doImport(ProgressMonitor progress) throws Exception {
progress.beginTask("Setting up Gerrit replication", 2);
String repositoryName = getOrganisation() + "/" + getRepositoryName();
progress.update(1);
replicationConfig.addSecureCredentials(authUsername, authToken);
progress.update(1);
replicationConfig.addReplicationRemote(
authUsername, gitHubUrl + "/${name}.git", repositoryName);
progress.endTask();
}