congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
UserBitShared$DrillPBError.getMessage
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: apache/drill

final String errMsgFromServer = resp.getError() != null ? resp.getError().getMessage() : "";
origin: apache/drill

@Override
public String getSchema() throws SQLException {
 checkOpen();
 try {
  UserProtos.GetServerMetaResp response = client.getServerMeta().get();
  if (response.getStatus() != UserProtos.RequestStatus.OK) {
   UserBitShared.DrillPBError drillError = response.getError();
   throw new SQLException("Error when getting server meta: " + drillError.getMessage());
  }
  UserProtos.ServerMeta serverMeta = response.getServerMeta();
  String currentSchema = serverMeta.hasCurrentSchema() ? serverMeta.getCurrentSchema() : null;
  return StringUtils.isEmpty(currentSchema) ? null : currentSchema;
 } catch (InterruptedException | ExecutionException e) {
  throw new SQLException("Error when getting server meta", e);
 }
}
origin: apache/drill

private ServerMeta getServerMeta() throws SQLException {
 assert getServerMetaSupported();
 if (serverMeta == null) {
  synchronized(this) {
   if (serverMeta == null) {
    DrillConnectionImpl connection = (DrillConnectionImpl) getConnection();
    try {
     GetServerMetaResp resp = connection.getClient().getServerMeta().get();
     if (resp.getStatus() != RequestStatus.OK) {
      DrillPBError drillError = resp.getError();
      throw new SQLException("Error when getting server meta: " + drillError.getMessage());
     }
     serverMeta = resp.getServerMeta();
     convertSupport = SQLConvertSupport.toSQLConvertSupport(serverMeta.getConvertSupportList());
    } catch (InterruptedException e) {
     throw new SQLException("Interrupted when getting server meta", e);
    } catch (ExecutionException e) {
     Throwable cause =  e.getCause();
     if (cause == null) {
      throw new AssertionError("Something unknown happened", e);
     }
     Throwables.throwIfUnchecked(cause);
     throw new SQLException("Error when getting server meta", cause);
    }
   }
  }
 }
 return serverMeta;
}
origin: org.apache.drill.exec/drill-jdbc

final String errMsgFromServer = resp.getError() != null ? resp.getError().getMessage() : "";
origin: org.apache.drill.exec/drill-jdbc

throw new DrillRuntimeException(new SQLException("Failure getting metadata: " + error.getMessage()));
origin: org.apache.drill.exec/drill-jdbc

private ServerMeta getServerMeta() throws SQLException {
 assert getServerMetaSupported();
 if (serverMeta == null) {
  synchronized(this) {
   if (serverMeta == null) {
    DrillConnectionImpl connection = (DrillConnectionImpl) getConnection();
    try {
     GetServerMetaResp resp = connection.getClient().getServerMeta().get();
     if (resp.getStatus() != RequestStatus.OK) {
      DrillPBError drillError = resp.getError();
      throw new SQLException("Error when getting server meta: " + drillError.getMessage());
     }
     serverMeta = resp.getServerMeta();
     convertSupport = SQLConvertSupport.toSQLConvertSupport(serverMeta.getConvertSupportList());
    } catch (InterruptedException e) {
     throw new SQLException("Interrupted when getting server meta", e);
    } catch (ExecutionException e) {
     Throwable cause =  e.getCause();
     if (cause == null) {
      throw new AssertionError("Something unknown happened", e);
     }
     Throwables.throwIfUnchecked(cause);
     throw new SQLException("Error when getting server meta", cause);
    }
   }
  }
 }
 return serverMeta;
}
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

@Override
public String getMessage() {
 return error.getMessage(); // we don't want super class to generate the error message
}
origin: org.apache.drill/drill-protocol

/**
 * <code>optional string message = 4;</code>
 */
public Builder clearMessage() {
 bitField0_ = (bitField0_ & ~0x00000008);
 message_ = getDefaultInstance().getMessage();
 onChanged();
 return this;
}
/**
origin: apache/drill

throw new DrillRuntimeException(new SQLException("Failure getting metadata: " + error.getMessage()));
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

@Override
public String getMessage() {
 return error.getMessage(); // we don't want super class to generate the error message
}
origin: apache/drill

@Test
public void testBuildUserExceptionWithUserExceptionCauseAndMessage() {
 String messageA = "Test message A";
 String messageB = "Test message B";
 UserException original = UserException.connectionError().message(messageA).build(logger);
 UserException uex = UserException.dataWriteError(wrap(original, 5)).message(messageB).build(logger);
 //builder should return the unwrapped original user exception and not build a new one
 Assert.assertEquals(original, uex);
 DrillPBError error = uex.getOrCreatePBError(false);
 Assert.assertEquals(messageA, uex.getOriginalMessage());
 Assert.assertFalse(error.getMessage().contains(messageB)); // messageB should not be part of the context
}
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: apache/drill

/**
 * <code>optional string message = 4;</code>
 */
public Builder clearMessage() {
 bitField0_ = (bitField0_ & ~0x00000008);
 message_ = getDefaultInstance().getMessage();
 onChanged();
 return this;
}
/**
org.apache.drill.exec.protoUserBitShared$DrillPBErrorgetMessage

Javadoc

optional string message = 4;

Popular methods of UserBitShared$DrillPBError

  • getErrorType
    optional .exec.shared.DrillPBError.ErrorType error_type = 3;
  • 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

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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