Tabnine Logo
UserBitShared$DrillPBError.getErrorType
Code IndexAdd Tabnine to your IDE (free)

How to use
getErrorType
method
in
org.apache.drill.exec.proto.UserBitShared$DrillPBError

Best Java code snippets using org.apache.drill.exec.proto.UserBitShared$DrillPBError.getErrorType (Showing top 11 results out of 315)

origin: apache/drill

@Test
public void testBuildSystemException() {
 String message = "This is an exception";
 UserException uex = UserException.systemError(new Exception(new RuntimeException(message))).build(logger);
 Assert.assertTrue(uex.getOriginalMessage().contains(message));
 Assert.assertTrue(uex.getOriginalMessage().contains("RuntimeException"));
 DrillPBError error = uex.getOrCreatePBError(true);
 Assert.assertEquals(ErrorType.SYSTEM, error.getErrorType());
}
origin: apache/drill

setErrorType(other.getErrorType());
origin: apache/drill

@Test
public void testBuildUserExceptionWithCauseAndMessage() {
 String messageA = "Test message A";
 String messageB = "Test message B";
 UserException uex = UserException.dataWriteError(new RuntimeException(messageA)).message(messageB).build(logger);
 DrillPBError error = uex.getOrCreatePBError(false);
 // passed message should override the cause message
 Assert.assertEquals(ErrorType.DATA_WRITE, error.getErrorType());
 Assert.assertFalse(error.getMessage().contains(messageA)); // messageA should not be part of the context
 Assert.assertEquals(messageB, uex.getOriginalMessage());
}
origin: org.apache.drill/drill-protocol

setErrorType(other.getErrorType());
origin: org.apache.drill/drill-protocol

public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.UserBitShared.DrillPBError message) throws java.io.IOException
{
  if(message.hasErrorId())
    output.writeString(1, message.getErrorId(), false);
  if(message.hasEndpoint())
    output.writeObject(2, message.getEndpoint(), org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillbitEndpoint.WRITE, false);
  if(message.hasErrorType())
    output.writeEnum(3, message.getErrorType().getNumber(), false);
  if(message.hasMessage())
    output.writeString(4, message.getMessage(), false);
  if(message.hasException())
    output.writeObject(5, message.getException(), org.apache.drill.exec.proto.SchemaUserBitShared.ExceptionWrapper.WRITE, false);
  for(org.apache.drill.exec.proto.UserBitShared.ParsingError parsingError : message.getParsingErrorList())
    output.writeObject(6, parsingError, org.apache.drill.exec.proto.SchemaUserBitShared.ParsingError.WRITE, true);
}
public boolean isInitialized(org.apache.drill.exec.proto.UserBitShared.DrillPBError message)
origin: org.apache.drill/drill-common

public UserRemoteException(DrillPBError error) {
 super(error.getErrorType(), "Drill Remote Exception", getThrowable(error.getException()));
 this.error = error;
}
origin: apache/drill

public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.UserBitShared.DrillPBError message) throws java.io.IOException
{
  if(message.hasErrorId())
    output.writeString(1, message.getErrorId(), false);
  if(message.hasEndpoint())
    output.writeObject(2, message.getEndpoint(), org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillbitEndpoint.WRITE, false);
  if(message.hasErrorType())
    output.writeEnum(3, message.getErrorType().getNumber(), false);
  if(message.hasMessage())
    output.writeString(4, message.getMessage(), false);
  if(message.hasException())
    output.writeObject(5, message.getException(), org.apache.drill.exec.proto.SchemaUserBitShared.ExceptionWrapper.WRITE, false);
  for(org.apache.drill.exec.proto.UserBitShared.ParsingError parsingError : message.getParsingErrorList())
    output.writeObject(6, parsingError, org.apache.drill.exec.proto.SchemaUserBitShared.ParsingError.WRITE, true);
}
public boolean isInitialized(org.apache.drill.exec.proto.UserBitShared.DrillPBError message)
origin: apache/drill

public UserRemoteException(DrillPBError error) {
 super(error.getErrorType(), "Drill Remote Exception", getThrowable(error.getException()));
 this.error = error;
}
origin: apache/drill

@Test
public void testBuildUserExceptionWithCause() {
 String message = "Test message";
 UserException uex = UserException.dataWriteError(new RuntimeException(message)).build(logger);
 DrillPBError error = uex.getOrCreatePBError(false);
 // cause message should be used
 Assert.assertEquals(ErrorType.DATA_WRITE, error.getErrorType());
 Assert.assertEquals(message, uex.getOriginalMessage());
}
origin: apache/drill

@Test
public void testBuildUserExceptionWithMessage() {
 String message = "Test message";
 UserException uex = UserException.dataWriteError().message(message).build(logger);
 DrillPBError error = uex.getOrCreatePBError(false);
 Assert.assertEquals(ErrorType.DATA_WRITE, error.getErrorType());
 Assert.assertEquals(message, uex.getOriginalMessage());
}
origin: apache/drill

@Test
public void testBuildUserExceptionWithFormattedMessage() {
 String format = "This is test #%d";
 UserException uex = UserException.connectionError().message(format, 5).build(logger);
 DrillPBError error = uex.getOrCreatePBError(false);
 Assert.assertEquals(ErrorType.CONNECTION, error.getErrorType());
 Assert.assertEquals(String.format(format, 5), uex.getOriginalMessage());
}
org.apache.drill.exec.protoUserBitShared$DrillPBErrorgetErrorType

Javadoc

optional .exec.shared.DrillPBError.ErrorType error_type = 3;

Popular methods of UserBitShared$DrillPBError

  • getMessage
    optional string message = 4;
  • newBuilder
  • getException
    optional .exec.shared.ExceptionWrapper exception = 5;
  • <init>
  • getDefaultInstance
  • getDescriptor
  • getEndpoint
    optional .exec.DrillbitEndpoint endpoint = 2;
  • getErrorId
    optional string error_id = 1; for debug tracing purposes
  • getErrorIdBytes
    optional string error_id = 1; for debug tracing purposes
  • getMessageBytes
    optional string message = 4;
  • getParsingErrorList
    repeated .exec.shared.ParsingError parsing_error = 6; optional, used when providing location of err
  • getSerializedSize
  • getParsingErrorList,
  • getSerializedSize,
  • getUnknownFields,
  • hasEndpoint,
  • hasErrorId,
  • hasErrorType,
  • hasException,
  • hasMessage,
  • initFields

Popular in Java

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • setScale (BigDecimal)
  • findViewById (Activity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now