예제 #1
0
 // Constants for indexes into test case table below.
 // 1
 // 2
 // 3
 // 4
 // 4
 // 4
 // 4
 // 5
 // 6
 // 7
 // 8
 // 9
 // 10
 // 10
 // 10
 // 10
 // 11
 // 12
 // name-node specific cases
 // 13
 /// <summary>Writes an INFO log message containing the parameters.</summary>
 /// <remarks>
 /// Writes an INFO log message containing the parameters. Only
 /// the first 4 elements of the state array are included in the message.
 /// </remarks>
 internal virtual void Log(string label, int numDirs, int testCaseNum, bool[] state
                           )
 {
     Log.Info("============================================================");
     Log.Info("***TEST " + (testCounter++) + "*** " + label + ":" + " numDirs=" + numDirs
              + " testCase=" + testCaseNum + " current=" + state[CurrentExists] + " previous="
              + state[PreviousExists] + " previous.tmp=" + state[PreviousTmpExists] + " removed.tmp="
              + state[RemovedTmpExists] + " should recover=" + state[ShouldRecover] + " current exists after="
              + state[CurrentShouldExistAfterRecover] + " previous exists after=" + state[PreviousShouldExistAfterRecover
              ]);
 }
예제 #2
0
        /// <summary>Writes an INFO log message containing the parameters.</summary>
        internal virtual void Log(string label, HdfsServerConstants.NodeType nodeType, int
                                  testCase, TestDFSStartupVersions.StorageData sd)
        {
            string testCaseLine = string.Empty;

            if (testCase != null)
            {
                testCaseLine = " testCase=" + testCase;
            }
            Log.Info("============================================================");
            Log.Info("***TEST*** " + label + ":" + testCaseLine + " nodeType=" + nodeType + " layoutVersion="
                     + sd.storageInfo.GetLayoutVersion() + " namespaceID=" + sd.storageInfo.GetNamespaceID
                         () + " fsscTime=" + sd.storageInfo.GetCTime() + " clusterID=" + sd.storageInfo.GetClusterID
                         () + " BlockPoolID=" + sd.blockPoolId);
        }
예제 #3
0
            public override void Log(int level, string message)
            {
                switch (level)
                {
                case Logger.Debug:
                {
                    Log.Debug(message);
                    break;
                }

                case Logger.Info:
                {
                    Log.Info(message);
                    break;
                }

                case Logger.Warn:
                {
                    Log.Warn(message);
                    break;
                }

                case Logger.Error:
                {
                    Log.Error(message);
                    break;
                }

                case Logger.Fatal:
                {
                    Log.Fatal(message);
                    break;
                }

                default:
                {
                    break;
                }
                }
            }
예제 #4
0
 internal virtual bool Init(FairSchedulerConfiguration conf)
 {
     if (conf.IsEventLogEnabled())
     {
         try
         {
             logDir = conf.GetEventlogDir();
             FilePath logDirFile = new FilePath(logDir);
             if (!logDirFile.Exists())
             {
                 if (!logDirFile.Mkdirs())
                 {
                     throw new IOException("Mkdirs failed to create " + logDirFile.ToString());
                 }
             }
             string username = Runtime.GetProperty("user.name");
             logFile = string.Format("%s%shadoop-%s-fairscheduler.log", logDir, FilePath.separator
                                     , username);
             logDisabled = false;
             PatternLayout layout = new PatternLayout("%d{ISO8601}\t%m%n");
             appender = new DailyRollingFileAppender(layout, logFile, "'.'yyyy-MM-dd");
             appender.ActivateOptions();
             Log.Info("Initialized fair scheduler event log, logging to " + logFile);
         }
         catch (IOException e)
         {
             Log.Error("Failed to initialize fair scheduler event log. Disabling it.", e);
             logDisabled = true;
         }
     }
     else
     {
         logDisabled = true;
     }
     return(!(logDisabled));
 }
예제 #5
0
 /// <summary>Writes an INFO log message containing the parameters.</summary>
 internal virtual void Log(string label, int numDirs)
 {
     Log.Info("============================================================");
     Log.Info("***TEST " + (testCounter++) + "*** " + label + ":" + " numDirs=" + numDirs
              );
 }
예제 #6
0
 public virtual void Log(string message)
 {
     Log.Info(message);
 }