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



------------------ ???????? ------------------
??????: "????????????"<[email protected]>;
????????: 2018??5??21??(??????) ????11:43
??????: "user"<[email protected]>;

????: 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());
 
                }
 
        }

Reply via email to