org.apache.pig.impl.plan
Class CompilationMessageCollector

java.lang.Object
  extended by org.apache.pig.impl.plan.CompilationMessageCollector
All Implemented Interfaces:
Iterable<CompilationMessageCollector.Message>

public class CompilationMessageCollector
extends Object
implements Iterable<CompilationMessageCollector.Message>

This class is used for collecting all messages (error + warning) in compilation process. These messages are reported back to users at the end of compilation. iterator() has to be called after CompilationMessageCollector is fully populated otherwise the state is undefined.


Nested Class Summary
static class CompilationMessageCollector.Message
           
static class CompilationMessageCollector.MessageType
           
static class CompilationMessageCollector.Unknown
           
 
Constructor Summary
CompilationMessageCollector()
           
 
Method Summary
 void collect(String message, CompilationMessageCollector.MessageType messageType)
           
 void collect(String message, CompilationMessageCollector.MessageType messageType, Enum kind)
           
 CompilationMessageCollector.Message get(int i)
           
 Map<Enum,Long> getKindAggregate(CompilationMessageCollector.MessageType messageType)
           
 boolean hasError()
           
 boolean hasMessage()
           
protected  boolean hasMessageType(CompilationMessageCollector.MessageType messageType)
           
 Iterator<CompilationMessageCollector.Message> iterator()
           
static void logAggregate(Map<Enum,Long> aggMap, CompilationMessageCollector.MessageType messageType, org.apache.commons.logging.Log log)
           
static void logAllMessages(CompilationMessageCollector messageCollector, org.apache.commons.logging.Log log)
           
 void logAllMessages(org.apache.commons.logging.Log log)
           
 void logMessages(CompilationMessageCollector.MessageType messageType, boolean aggregate, org.apache.commons.logging.Log log)
           
static void logMessages(CompilationMessageCollector messageCollector, CompilationMessageCollector.MessageType messageType, boolean aggregate, org.apache.commons.logging.Log log)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompilationMessageCollector

public CompilationMessageCollector()
Method Detail

collect

public void collect(String message,
                    CompilationMessageCollector.MessageType messageType)

collect

public void collect(String message,
                    CompilationMessageCollector.MessageType messageType,
                    Enum kind)

hasMessageType

protected boolean hasMessageType(CompilationMessageCollector.MessageType messageType)

hasError

public boolean hasError()

iterator

public Iterator<CompilationMessageCollector.Message> iterator()
Specified by:
iterator in interface Iterable<CompilationMessageCollector.Message>

hasMessage

public boolean hasMessage()

size

public int size()

get

public CompilationMessageCollector.Message get(int i)

getKindAggregate

public Map<Enum,Long> getKindAggregate(CompilationMessageCollector.MessageType messageType)

logAggregate

public static void logAggregate(Map<Enum,Long> aggMap,
                                CompilationMessageCollector.MessageType messageType,
                                org.apache.commons.logging.Log log)

logMessages

public static void logMessages(CompilationMessageCollector messageCollector,
                               CompilationMessageCollector.MessageType messageType,
                               boolean aggregate,
                               org.apache.commons.logging.Log log)

logMessages

public void logMessages(CompilationMessageCollector.MessageType messageType,
                        boolean aggregate,
                        org.apache.commons.logging.Log log)

logAllMessages

public static void logAllMessages(CompilationMessageCollector messageCollector,
                                  org.apache.commons.logging.Log log)

logAllMessages

public void logAllMessages(org.apache.commons.logging.Log log)


Copyright © 2007-2012 The Apache Software Foundation