예제 #1
0
 public SimpleFileStorage(FileSystemAbstraction fileSystem, File directory, string name, ChannelMarshal <T> marshal, LogProvider logProvider)
 {
     this._fileSystem = fileSystem;
     this._log        = logProvider.getLog(this.GetType());
     this._file       = new File(DurableStateStorage.StateDir(directory, name), name);
     this._marshal    = marshal;
 }
예제 #2
0
 public UpdatePullerScheduler(JobScheduler scheduler, LogProvider logProvider, UpdatePuller updatePullingThread, long pullIntervalMillis)
 {
     this._scheduler          = scheduler;
     this._log                = logProvider.getLog(this.GetType());
     this._updatePuller       = updatePullingThread;
     this._pullIntervalMillis = pullIntervalMillis;
 }
예제 #3
0
 public RaftOutbound(CoreTopologyService coreTopologyService, Outbound <AdvertisedSocketAddress, Message> outbound, System.Func <Optional <ClusterId> > clusterIdentity, LogProvider logProvider, long logThresholdMillis)
 {
     this._coreTopologyService = coreTopologyService;
     this._outbound            = outbound;
     this._clusterIdentity     = clusterIdentity;
     this._log = logProvider.getLog(this.GetType());
     this._unknownAddressMonitor = new UnknownAddressMonitor(_log, Clocks.systemClock(), logThresholdMillis);
 }
예제 #4
0
 internal OnlineIndexSamplingJob(long indexId, IndexProxy indexProxy, IndexStoreView storeView, string indexUserDescription, LogProvider logProvider)
 {
     this._indexId              = indexId;
     this._indexProxy           = indexProxy;
     this._storeView            = storeView;
     this._log                  = logProvider.getLog(this.GetType());
     this._indexUserDescription = indexUserDescription;
 }
예제 #5
0
 public CoreStateDownloaderService(JobScheduler jobScheduler, CoreStateDownloader downloader, CommandApplicationProcess applicationProcess, LogProvider logProvider, Org.Neo4j.causalclustering.helper.TimeoutStrategy_Timeout downloaderPauseStrategy, System.Func <DatabaseHealth> dbHealth, Monitors monitors)
 {
     this._jobScheduler       = jobScheduler;
     this._downloader         = downloader;
     this._applicationProcess = applicationProcess;
     this._log = logProvider.getLog(this.GetType());
     this._downloaderPauseStrategy = downloaderPauseStrategy;
     this._dbHealth = dbHealth;
     this._monitors = monitors;
 }
예제 #6
0
        public TxPullRequestHandler(CatchupServerProtocol protocol, System.Func <StoreId> storeIdSupplier, System.Func <bool> databaseAvailable, System.Func <NeoStoreDataSource> dataSourceSupplier, Monitors monitors, LogProvider logProvider)
        {
            this._protocol          = protocol;
            this._storeIdSupplier   = storeIdSupplier;
            this._databaseAvailable = databaseAvailable;
            DependencyResolver dependencies = dataSourceSupplier().DependencyResolver;

            this._transactionIdStore      = dependencies.ResolveDependency(typeof(TransactionIdStore));
            this._logicalTransactionStore = dependencies.ResolveDependency(typeof(LogicalTransactionStore));
            this._monitor = monitors.NewMonitor(typeof(TxPullRequestsMonitor));
            this._log     = logProvider.getLog(this.GetType());
        }
예제 #7
0
        /// <summary>
        /// {@inheritDoc}
        /// </summary>
        public override OUTPUT Apply(INPUT retriableInput, System.Func <INPUT, OUTPUT> retriable, System.Predicate <OUTPUT> wasRetrySuccessful)
        {
            Log    log              = _logProvider.getLog(typeof(MultiRetryStrategy));
            OUTPUT result           = retriable(retriableInput);
            int    currentIteration = 0;

            while (!wasRetrySuccessful(result) && currentIteration++ < _retries)
            {
                log.Debug("Try attempt was unsuccessful for input: %s\n", retriableInput);
                _sleeper.accept(_delayInMillis);
                result = retriable(retriableInput);
            }
            return(result);
        }
예제 #8
0
 internal RaftLogShipper(Outbound <MemberId, Org.Neo4j.causalclustering.core.consensus.RaftMessages_RaftMessage> outbound, LogProvider logProvider, ReadableRaftLog raftLog, Clock clock, TimerService timerService, MemberId leader, MemberId follower, long leaderTerm, long leaderCommit, long retryTimeMillis, int catchupBatchSize, int maxAllowedShippingLag, InFlightCache inFlightCache)
 {
     this._outbound              = outbound;
     this._timerService          = timerService;
     this._catchupBatchSize      = catchupBatchSize;
     this._maxAllowedShippingLag = maxAllowedShippingLag;
     this._log               = logProvider.getLog(this.GetType());
     this._raftLog           = raftLog;
     this._clock             = clock;
     this._follower          = follower;
     this._leader            = leader;
     this._retryTimeMillis   = retryTimeMillis;
     this._lastLeaderContext = new LeaderContext(leaderTerm, leaderCommit);
     this._inFlightCache     = inFlightCache;
 }
예제 #9
0
        // --------- HELPERS ----------

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup()
        public virtual void Setup()
        {
            _config          = mock(typeof(Config));
            _mockLogProvider = mock(typeof(LogProvider));
            Log mockLog = mock(typeof(Log));

            when(_mockLogProvider.getLog(anyString())).thenReturn(mockLog);
            when(mockLog.DebugEnabled).thenReturn(true);
            when(_config.get(SecuritySettings.property_level_authorization_enabled)).thenReturn(false);
            when(_config.get(SecuritySettings.auth_cache_ttl)).thenReturn(Duration.ZERO);
            when(_config.get(SecuritySettings.auth_cache_max_capacity)).thenReturn(10);
            when(_config.get(SecuritySettings.auth_cache_use_ttl)).thenReturn(true);
            when(_config.get(SecuritySettings.security_log_successful_authentication)).thenReturn(false);
            when(_config.get(GraphDatabaseSettings.auth_max_failed_attempts)).thenReturn(3);
            when(_config.get(GraphDatabaseSettings.auth_lock_time)).thenReturn(Duration.ofSeconds(5));
        }
예제 #10
0
 internal virtual IndexProxy CreateOnlineIndexProxy(StoreIndexDescriptor descriptor)
 {
     try
     {
         IndexAccessor          onlineAccessor         = OnlineAccessorFromProvider(descriptor, _samplingConfig);
         CapableIndexDescriptor capableIndexDescriptor = _providerMap.withCapabilities(descriptor);
         IndexProxy             proxy;
         proxy = new OnlineIndexProxy(capableIndexDescriptor, onlineAccessor, _storeView, false);
         proxy = new ContractCheckingIndexProxy(proxy, true);
         return(proxy);
     }
     catch (IOException e)
     {
         _logProvider.getLog(this.GetType()).error("Failed to open index: " + descriptor.Id + " (" + descriptor.UserDescription(_tokenNameLookup) + "), requesting re-population.", e);
         return(CreateRecoveringIndexProxy(descriptor));
     }
 }
예제 #11
0
 internal WaitForUpToDateStore(CatchupPollingProcess catchupProcess, LogProvider logProvider)
 {
     this._catchupProcess = catchupProcess;
     this._log            = logProvider.getLog(this.GetType());
 }
예제 #12
0
 public ServerMessageTypeHandler(CatchupServerProtocol protocol, LogProvider logProvider)
 {
     this._protocol = protocol;
     this._log      = logProvider.getLog(this.GetType());
 }
예제 #13
0
 public BranchDetectingTxVerifier(LogProvider logProvider, TransactionChecksumLookup txChecksumLookup)
 {
     this._log = logProvider.getLog(this.GetType());
     this._txChecksumLookup = txChecksumLookup;
 }
예제 #14
0
 public PreFlightTasks(LogProvider logProvider, params PreflightTask[] tasks)
 {
     this._tasks = tasks;
     this._log   = logProvider.getLog(this.GetType());
 }
예제 #15
0
 public ClusterLeaveReelectionListener(Election election, LogProvider logProvider)
 {
     this._election = election;
     this._log      = logProvider.getLog(this.GetType());
 }
예제 #16
0
 public FileHeaderHandler(CatchupClientProtocol protocol, CatchUpResponseHandler handler, LogProvider logProvider)
 {
     this._protocol = protocol;
     this._handler  = handler;
     this._log      = logProvider.getLog(this.GetType());
 }
예제 #17
0
 public ClientMessageTypeHandler(CatchupClientProtocol protocol, LogProvider logProvider)
 {
     this._protocol = protocol;
     this._log      = logProvider.getLog(this.GetType());
 }
예제 #18
0
 public HeartbeatReelectionListener(Election election, LogProvider logProvider)
 {
     this._election = election;
     this._log      = logProvider.getLog(this.GetType());
 }
예제 #19
0
 public override ILogger GetLogger(string name)
 {
     return(new HazelcastLogger(_logProvider.getLog(name), _minLevel));
 }
예제 #20
0
 private Log Log()
 {
     return(_logProvider.getLog(this.GetType()));
 }
예제 #21
0
 public CypherExecutor(Database database, LogProvider logProvider)
 {
     this._database = database;
     _log           = logProvider.getLog(this.GetType());
 }
예제 #22
0
 public HeartbeatLeftListener(HeartbeatContext heartbeatContext, LogProvider logProvider)
 {
     this._heartbeatContext = heartbeatContext;
     this._log = logProvider.getLog(this.GetType());
 }
예제 #23
0
 public ExplicitIndexMigrator(FileSystemAbstraction fileSystem, ExplicitIndexProvider explicitIndexProvider, LogProvider logProvider) : base("Explicit indexes")
 {
     this._fileSystem            = fileSystem;
     this._explicitIndexProvider = explicitIndexProvider;
     this._log = logProvider.getLog(this.GetType());
 }
예제 #24
0
 public HighAvailabilityLogger(LogProvider logProvider, InstanceId myId)
 {
     this._log  = logProvider.getLog(this.GetType());
     this._myId = myId;
 }