/// <exception cref="System.IO.IOException"/>
 internal QuorumJournalManager(Configuration conf, URI uri, NamespaceInfo nsInfo,
                               AsyncLogger.Factory loggerFactory)
 {
     // Timeouts for which the QJM will wait for each of the following actions.
     // Since these don't occur during normal operation, we can
     // use rather lengthy timeouts, and don't need to make them
     // configurable.
     Preconditions.CheckArgument(conf != null, "must be configured");
     this.conf              = conf;
     this.uri               = uri;
     this.nsInfo            = nsInfo;
     this.loggers           = new AsyncLoggerSet(CreateLoggers(loggerFactory));
     this.connectionFactory = URLConnectionFactory.NewDefaultURLConnectionFactory(conf
                                                                                  );
     // Configure timeouts.
     this.startSegmentTimeoutMs = conf.GetInt(DFSConfigKeys.DfsQjournalStartSegmentTimeoutKey
                                              , DFSConfigKeys.DfsQjournalStartSegmentTimeoutDefault);
     this.prepareRecoveryTimeoutMs = conf.GetInt(DFSConfigKeys.DfsQjournalPrepareRecoveryTimeoutKey
                                                 , DFSConfigKeys.DfsQjournalPrepareRecoveryTimeoutDefault);
     this.acceptRecoveryTimeoutMs = conf.GetInt(DFSConfigKeys.DfsQjournalAcceptRecoveryTimeoutKey
                                                , DFSConfigKeys.DfsQjournalAcceptRecoveryTimeoutDefault);
     this.finalizeSegmentTimeoutMs = conf.GetInt(DFSConfigKeys.DfsQjournalFinalizeSegmentTimeoutKey
                                                 , DFSConfigKeys.DfsQjournalFinalizeSegmentTimeoutDefault);
     this.selectInputStreamsTimeoutMs = conf.GetInt(DFSConfigKeys.DfsQjournalSelectInputStreamsTimeoutKey
                                                    , DFSConfigKeys.DfsQjournalSelectInputStreamsTimeoutDefault);
     this.getJournalStateTimeoutMs = conf.GetInt(DFSConfigKeys.DfsQjournalGetJournalStateTimeoutKey
                                                 , DFSConfigKeys.DfsQjournalGetJournalStateTimeoutDefault);
     this.newEpochTimeoutMs = conf.GetInt(DFSConfigKeys.DfsQjournalNewEpochTimeoutKey,
                                          DFSConfigKeys.DfsQjournalNewEpochTimeoutDefault);
     this.writeTxnsTimeoutMs = conf.GetInt(DFSConfigKeys.DfsQjournalWriteTxnsTimeoutKey
                                           , DFSConfigKeys.DfsQjournalWriteTxnsTimeoutDefault);
 }
 /// <exception cref="System.Exception"/>
 private static void WaitForAllPendingCalls(AsyncLoggerSet als)
 {
     foreach (AsyncLogger l in als.GetLoggersForTests())
     {
         IPCLoggerChannel ch = (IPCLoggerChannel)l;
         ch.WaitForAllPendingCalls();
     }
 }
Example #3
0
 /// <exception cref="System.IO.IOException"/>
 public QuorumOutputStream(AsyncLoggerSet loggers, long txId, int outputBufferCapacity
                           , int writeTimeoutMs)
     : base()
 {
     this.buf            = new EditsDoubleBuffer(outputBufferCapacity);
     this.loggers        = loggers;
     this.segmentTxId    = txId;
     this.writeTimeoutMs = writeTimeoutMs;
 }