Exemple #1
0
        /// <exception cref="Org.Apache.Hadoop.Ipc.StandbyException"/>
        public override void CheckOperation(HAContext context, NameNode.OperationCategory
                                            op)
        {
            if (op == NameNode.OperationCategory.Unchecked || (op == NameNode.OperationCategory
                                                               .Read && context.AllowStaleReads()))
            {
                return;
            }
            string msg = "Operation category " + op + " is not supported in state " + context
                         .GetState();

            throw new StandbyException(msg);
        }
Exemple #2
0
 /// <exception cref="Org.Apache.Hadoop.Ipc.StandbyException"/>
 public override void CheckOperation(NameNode.OperationCategory op)
 {
     // NameNodeHAContext
     if (op == NameNode.OperationCategory.Unchecked || op == NameNode.OperationCategory
         .Checkpoint)
     {
         return;
     }
     if (NameNode.OperationCategory.Journal != op && !(NameNode.OperationCategory.Read
                                                       == op && !this._enclosing.IsRole(HdfsServerConstants.NamenodeRole.Checkpoint)))
     {
         string msg = "Operation category " + op + " is not supported at " + this._enclosing
                      .GetRole();
         throw new StandbyException(msg);
     }
 }
Exemple #3
0
 /// <summary>Check if an operation is supported in a given state.</summary>
 /// <param name="context">HA context</param>
 /// <param name="op">Type of the operation.</param>
 /// <exception cref="Org.Apache.Hadoop.Ipc.StandbyException">
 /// if a given type of operation is not
 /// supported in standby state
 /// </exception>
 public abstract void CheckOperation(HAContext context, NameNode.OperationCategory
                                     op);
Exemple #4
0
 public override void CheckOperation(HAContext context, NameNode.OperationCategory
                                     op)
 {
     return;
 }
Exemple #5
0
 /// <exception cref="Org.Apache.Hadoop.Ipc.StandbyException"/>
 public override void CheckOperation(HAContext context, NameNode.OperationCategory
                                     op)
 {
     // HAState
     context.CheckOperation(op);
 }