当前位置: 首页>>代码示例>>Java>>正文


Java ProgressEvent.COMPLETED_EVENT_CODE属性代码示例

本文整理汇总了Java中com.amazonaws.event.ProgressEvent.COMPLETED_EVENT_CODE属性的典型用法代码示例。如果您正苦于以下问题:Java ProgressEvent.COMPLETED_EVENT_CODE属性的具体用法?Java ProgressEvent.COMPLETED_EVENT_CODE怎么用?Java ProgressEvent.COMPLETED_EVENT_CODE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.amazonaws.event.ProgressEvent的用法示例。


在下文中一共展示了ProgressEvent.COMPLETED_EVENT_CODE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: progressChanged

public void progressChanged(ProgressEvent progressEvent) {
  if (progress != null) {
    progress.progress();
  }

  // There are 3 http ops here, but this should be close enough for now
  if (progressEvent.getEventCode() == ProgressEvent.PART_STARTED_EVENT_CODE ||
      progressEvent.getEventCode() == ProgressEvent.COMPLETED_EVENT_CODE) {
    statistics.incrementWriteOps(1);
  }

  long transferred = upload.getProgress().getBytesTransferred();
  long delta = transferred - lastBytesTransferred;
  if (statistics != null && delta != 0) {
    statistics.incrementBytesWritten(delta);
  }

  lastBytesTransferred = transferred;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:S3AOutputStream.java

示例2: progressChanged

@Override
public void progressChanged( final ProgressEvent progressEvent )
{
    this.bytesTransferred += progressEvent.getBytesTransferred();
    if ( this.bytesTransferred >= this.lastNotifiedBytesTransferred + ONE_MEGABYTE )
    {
        logger.info( "Transferring {}, {} of {} bytes complete.",
                     this.filename,
                     this.bytesTransferred,
                     this.fileSize );
        this.lastNotifiedBytesTransferred = this.bytesTransferred;
    }
    switch ( progressEvent.getEventCode() )
    {
        case ProgressEvent.STARTED_EVENT_CODE:
            logger.info( "Started transferring {}, {} of {} bytes complete.",
                         this.filename,
                         this.bytesTransferred,
                         this.fileSize );
            break;

        case ProgressEvent.PART_STARTED_EVENT_CODE:
            this.partsStarted++;
            logger.info( "Started transferring part {} of {}, {} of {} bytes complete.",
                         this.partsStarted,
                         this.filename,
                         this.bytesTransferred,
                         this.fileSize );
            break;

        case ProgressEvent.PART_COMPLETED_EVENT_CODE:
            this.partsCompleted++;
            logger.info( "Completed transferring part {} of {}, {} of {} bytes complete.",
                         this.partsCompleted,
                         this.filename,
                         this.bytesTransferred,
                         this.fileSize );
            break;

        case ProgressEvent.COMPLETED_EVENT_CODE:
            logger.info( "Completed transferring {}, {} of {} bytes complete.",
                         this.filename,
                         this.bytesTransferred,
                         this.fileSize );
            break;
    }
}
 
开发者ID:stevenmhood,项目名称:transcoder,代码行数:47,代码来源:S3ProgressListener.java


注:本文中的com.amazonaws.event.ProgressEvent.COMPLETED_EVENT_CODE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。