Exemple #1
0
        /// <summary>
        /// Start up the connection to the Seaweedfs server
        /// </summary>
        public async Task Start()
        {
            if (_running)
            {
                System.Diagnostics.Debug.WriteLine("connect is already startup");
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("start connect to the seaweedfs master server [" +
                                                   ConnectionUtil.ConvertUrlWithScheme(Host + ":" + Port) + "]");

                if (_connection == null)
                {
                    _connection = new Connection(
                        ConnectionUtil.ConvertUrlWithScheme(Host + ":" + Port),
                        ConnectionTimeout,
                        StatusExpiry,
                        MaxConnection,
                        EnableLookupVolumeCache,
                        LookupVolumeCacheExpiry);
                }
                await _connection.Start();

                _running = true;
            }
        }
Exemple #2
0
 void OnDeserialized(StreamingContext context)
 {
     Url       = ConnectionUtil.ConvertUrlWithScheme(Url);
     PublicUrl = string.IsNullOrEmpty(PublicUrl)
         ? Url
         : ConnectionUtil.ConvertUrlWithScheme(PublicUrl);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="leaderUrl"></param>
 /// <param name="connectionTimeout">in milliseconds</param>
 /// <param name="statusExpiry">in milliseconds</param>
 /// <param name="maxConnection"></param>
 /// <param name="isLookupVolumeCacheEnabled"></param>
 /// <param name="lookupVolumeCacheExpiry"></param>
 public Connection(string leaderUrl, int connectionTimeout, int statusExpiry,
                   int maxConnection, bool isLookupVolumeCacheEnabled,
                   int lookupVolumeCacheExpiry)
 {
     LeaderUrl                  = ConnectionUtil.ConvertUrlWithScheme(leaderUrl);
     ConnectionTimeout          = connectionTimeout;
     StatusExpiry               = statusExpiry;
     IsLookupVolumeCacheEnabled = isLookupVolumeCacheEnabled;
     LookupVolumeCacheExpiry    = lookupVolumeCacheExpiry;
     MaxConnections             = maxConnection;
     ConnectionClose            = false;
 }
Exemple #4
0
 void OnDeserialized(StreamingContext context)
 {
     Url = ConnectionUtil.ConvertUrlWithScheme(Url);
 }
Exemple #5
0
 public MasterStatus(string url)
 {
     Url = ConnectionUtil.ConvertUrlWithScheme(url);
 }