Exemplo n.º 1
0
 public void setReplicationHandler(PassiveReplicationHandler replicationHandler)
 {
     this.replicationHandler = replicationHandler;
 }
Exemplo n.º 2
0
        public void initialize(int port, String id)
        {
            Port = port;
            Id = id;
            FileMetadata = new SerializableDictionary<String, FileMetadata>();
            fileMetadataLocks = new SerializableDictionary<string, ManualResetEvent>();
            DataServers = new SerializableDictionary<String, ServerObjectWrapper>();
            Heartbeats = new SerializableDictionary<string, Queue<HeartbeatMessage>>();
            FileAccesses = new Dictionary<string, Dictionary<string, FileAccessCounter>>();
            Log = new MetaDataLog();
            Log.init(this);
            isFailing = false;
            isRecovering = false;
            requestsQueue = new Queue<MetaDataOperation>();
            CheckpointCounter = 0;
            migratingFiles = new SerializableDictionary<string, List<Tuple<string, string>>>();

            Console.Title = "MDS " + Id;
            this.replicationHandler = new PassiveReplicationHandler(IdAsNumber);
            getCheckpoint(Id);

            //atach a debugger - we should add some parameter to enable/disable this!
            if (Boolean.Parse(Properties.Resources.RUN_IN_DEBUG_MODE) && !Debugger.IsAttached)
            {
                Debugger.Launch();
            }
        }