summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-scheduler
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2013-02-07 22:21:55 +0000
committerOlivier Lamy <olamy@apache.org>2013-02-07 22:21:55 +0000
commitf60f64732ab0842ba2da060cded094dfdb7dc01b (patch)
treebfb43c2848b28068612df42be14bad68c446f4ff /archiva-modules/archiva-scheduler
parent440d85c3ccccafde62545238e6a0499e125b804d (diff)
downloadarchiva-f60f64732ab0842ba2da060cded094dfdb7dc01b.tar.gz
archiva-f60f64732ab0842ba2da060cded094dfdb7dc01b.zip
improve logging and no need to pack local index of remote repositories
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1443759 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-scheduler')
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java2
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java20
2 files changed, 12 insertions, 10 deletions
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java
index 9fe52c12a..d2405c66c 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java
@@ -187,7 +187,7 @@ public class DefaultDownloadRemoteIndexScheduler
if ( now )
{
log.info( "schedule download remote index for repository {}", remoteRepository.getId() );
- // do it in async
+ // do it now
taskScheduler.schedule(
new DownloadRemoteIndexTask( downloadRemoteIndexTaskRequest, this.runningRemoteDownloadIds ),
new Date() );
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java
index c504bac5d..232b7abbd 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java
@@ -84,7 +84,6 @@ public class DownloadRemoteIndexTask
private IndexUpdater indexUpdater;
- private IndexPacker indexPacker;
public DownloadRemoteIndexTask( DownloadRemoteIndexTaskRequest downloadRemoteIndexTaskRequest,
List<String> runningRemoteDownloadIds )
@@ -96,7 +95,6 @@ public class DownloadRemoteIndexTask
this.runningRemoteDownloadIds = runningRemoteDownloadIds;
this.indexUpdater = downloadRemoteIndexTaskRequest.getIndexUpdater();
this.remoteRepositoryAdmin = downloadRemoteIndexTaskRequest.getRemoteRepositoryAdmin();
- this.indexPacker = downloadRemoteIndexTaskRequest.getIndexPacker();
}
public void run()
@@ -188,13 +186,13 @@ public class DownloadRemoteIndexTask
this.indexUpdater.fetchAndUpdateIndex( request );
stopWatch.stop();
- log.info( "time to download remote repository index for repository {}: {} s", this.remoteRepository.getId(),
+ log.info( "time update index from remote for repository {}: {} s", this.remoteRepository.getId(),
( stopWatch.getTime() / 1000 ) );
// index packing optionnal ??
- IndexPackingRequest indexPackingRequest =
- new IndexPackingRequest( indexingContext, indexingContext.getIndexDirectoryFile() );
- indexPacker.packIndex( indexPackingRequest );
+ //IndexPackingRequest indexPackingRequest =
+ // new IndexPackingRequest( indexingContext, indexingContext.getIndexDirectoryFile() );
+ //indexPacker.packIndex( indexPackingRequest );
indexingContext.updateTimestamp( true );
}
@@ -258,30 +256,34 @@ public class DownloadRemoteIndexTask
private long startTime;
+ private int totalLength = 0;
+
public void transferInitiated( TransferEvent transferEvent )
{
+ startTime = System.currentTimeMillis();
resourceName = transferEvent.getResource().getName();
log.debug( "initiate transfer of {}", resourceName );
}
public void transferStarted( TransferEvent transferEvent )
{
+ this.totalLength = 0;
resourceName = transferEvent.getResource().getName();
- startTime = System.currentTimeMillis();
log.info( "start transfer of {}", transferEvent.getResource().getName() );
}
public void transferProgress( TransferEvent transferEvent, byte[] buffer, int length )
{
log.debug( "transfer of {} : {}/{}", transferEvent.getResource().getName(), buffer.length, length );
+ this.totalLength += length;
}
public void transferCompleted( TransferEvent transferEvent )
{
resourceName = transferEvent.getResource().getName();
long endTime = System.currentTimeMillis();
- log.info( "end of transfer file {}: {}s", transferEvent.getResource().getName(),
- ( endTime - startTime ) / 1000 );
+ log.info( "end of transfer file {} {} kb: {}s", transferEvent.getResource().getName(),
+ this.totalLength / 1024, ( endTime - startTime ) / 1000 );
}
public void transferError( TransferEvent transferEvent )