flume-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "基勇" <252637...@qq.com>
Subject 回复:flume transaction close to begin cost 3-5 seconds
Date Mon, 21 May 2018 17:01:29 GMT
log:
2018-05-22 00:03:46,529 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - org.apache.flume.sink.sequoiadb.SequoiaDBOneSink.process(SequoiaDBOneSink.java:310)]
transaction begin timestamp is :1526918626529
2018-05-22 00:03:49,533 (SinkRunner-PollingRunner-DefaultSinkProcessor) [DEBUG - org.apache.flume.sink.sequoiadb.SequoiaDBOneSink.drainOne(SequoiaDBOneSink.java:410)]
End for floor,the txnEventCount is :0
2018-05-22 00:03:49,533 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - org.apache.flume.sink.sequoiadb.SequoiaDBOneSink.process(SequoiaDBOneSink.java:319)]
transaction commit timestamp is :1526918629533
2018-05-22 00:03:49,533 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - org.apache.flume.sink.sequoiadb.SequoiaDBOneSink.process(SequoiaDBOneSink.java:341)]
transaction close timestamp is :1526918629533
2018-05-22 00:03:54,538 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - org.apache.flume.sink.sequoiadb.SequoiaDBOneSink.process(SequoiaDBOneSink.java:310)]
transaction begin timestamp is :1526918634538



------------------ 原始邮件 ------------------
发件人: "真心の傻子楓"<252637867@qq.com>;
发送时间: 2018年5月21日(星期一) 晚上11:43
收件人: "user"<user@flume.apache.org>;

主题: flume transaction close to begin cost 3-5 seconds



 Hi,guys:
     I use flume to read data written to sequoiadb, channel uses kafka channel, sink is developed
to flume sequoiadb sink itself, testing the time to write sequoiadb, but transation close
to begin even takes 3-5 seconds.
     Why does the transaction take so long to close to open?
     Is there a partner who can help me?  3Q


code:
 
@Override
 
	public Status process() throws EventDeliveryException {
 
		// TODO Auto-generated method stub
 
		Channel channel = getChannel();
 
	    Transaction transaction = channel.getTransaction();
 
	    LOG.info("transaction begin timestamp is :"+System.currentTimeMillis());
 
	    transaction.begin();
 
	    boolean success = false;
 
        
 
        try {
 
        	int txnEventCount = drainOne(channel);
 
			
 
			transaction.commit();
 
	        success = true;
 
	        LOG.info("transaction commit timestamp is :"+System.currentTimeMillis());
 
	        if (txnEventCount < 1) {
 
	          return Status.BACKOFF;
 
	        } else {
 
	          return Status.READY;
 
	        }
 
	        
 
		} catch (BaseException e) {
 
			LOG.error(e.getMessage(),e);
 
			return Status.BACKOFF;
 
		} catch (InterruptedException e) {
 
			LOG.error(e.getMessage(),e);
 
			return Status.BACKOFF;
 
		} catch (Exception e){
 
			throw new EventDeliveryException(e);
 
		}finally{
 
			if (!success) {
 
		        transaction.rollback();
 
		      }
 
		      transaction.close();
 
		      LOG.info("transaction close timestamp is :"+System.currentTimeMillis());
 
		}
 
	}
Mime
View raw message