private CommandProcessorResponse returnErrorResponse(final String errmsg) { return new CommandProcessorResponse(1, "LLAP Cache Processor Helper Failed:" + errmsg, null); }
private CommandProcessorResponse returnErrorResponse(final String errmsg) { return new CommandProcessorResponse(1, "Encryption Processor Helper Failed:" + errmsg, null); }
private CommandProcessorResponse returnErrorResponse(final String errmsg) { return new CommandProcessorResponse(1, "Erasure Processor Helper Failed: " + errmsg, null); }
private CommandProcessorResponse returnErrorResponse(final String errmsg) { return new CommandProcessorResponse(1, "LLAP Cluster Processor Helper Failed:" + errmsg, null); }
private CommandProcessorResponse returnErrorResponse(final String errmsg) { return new CommandProcessorResponse(1, "Encryption Processor Helper Failed:" + errmsg, null); }
/** * Create CommandProcessorResponse object indicating an error. * Creates new CommandProcessorResponse with responseCode=1, and sets message * from exception argument * * @param e * @return */ public static CommandProcessorResponse create(Exception e) { return new CommandProcessorResponse(1, e.getMessage(), null); }
/** * Create CommandProcessorResponse object indicating an error. * Creates new CommandProcessorResponse with responseCode=1, and sets message * from exception argument * * @param e * @return */ public static CommandProcessorResponse create(Exception e) { return new CommandProcessorResponse(1, e.getMessage(), null); }
public CommandProcessorResponse executeSetVariable(String varname, String varvalue) { try { return setVariable(varname, varvalue); } catch (Exception e) { return new CommandProcessorResponse(1, e.getMessage(), "42000", e instanceof IllegalArgumentException ? null : e); } }
private CommandProcessorResponse createProcessorSuccessResponse() { return new CommandProcessorResponse(0, null, null, getSchema()); }
private CommandProcessorResponse createProcessorSuccessResponse() { return new CommandProcessorResponse(0, null, null, getSchema()); }
private CommandProcessorResponse createProcessorSuccessResponse() { return new CommandProcessorResponse(0, null, null, getSchema()); }
public CommandProcessorResponse executeSetVariable(String varname, String varvalue) { try { return setVariable(varname, varvalue); } catch (Exception e) { return new CommandProcessorResponse(1, e.getMessage(), "42000", e instanceof IllegalArgumentException ? null : e); } }
private CommandProcessorResponse createProcessorSuccessResponse() { return new CommandProcessorResponse(0, null, null, getSchema()); }
@Override public CommandProcessorResponse run(String command) { SessionState ss = SessionState.get(); try { ss.loadReloadableAuxJars(); } catch (IOException e) { LOG.error("fail to reload auxiliary jar files", e); return CommandProcessorResponse.create(e); } return new CommandProcessorResponse(0); }
@Override public CommandProcessorResponse run(String command) { SessionState ss = SessionState.get(); String[] tokens = command.split("\\s+"); SessionState.ResourceType t; if (tokens.length < 1 || (t = SessionState.find_resource_type(tokens[0])) == null) { String message = "Usage: list [" + StringUtils.join(SessionState.ResourceType.values(), "|") + "] [<value> [<value>]*]"; return new CommandProcessorResponse(1, message, null); } List<String> filter = null; if (tokens.length > 1) { filter = Arrays.asList(Arrays.copyOfRange(tokens, 1, tokens.length)); } Set<String> s = ss.list_resource(t, filter); if (s != null && !s.isEmpty()) { ss.out.println(StringUtils.join(s, "\n")); } return new CommandProcessorResponse(0, null, null, SCHEMA); }
private CommandProcessorResponse createProcessorResponse(int ret) { SessionState.getPerfLogger().cleanupPerfLogMetrics(); queryDisplay.setErrorMessage(errorMessage); if(downstreamError != null && downstreamError instanceof HiveException) { ErrorMsg em = ((HiveException)downstreamError).getCanonicalErrorMsg(); if(em != null) { return new CommandProcessorResponse(ret, errorMessage, SQLState, schema, downstreamError, em.getErrorCode(), null); } } return new CommandProcessorResponse(ret, errorMessage, SQLState, downstreamError); }
@Override public CommandProcessorResponse run(String command) throws CommandNeedRetryException { SessionState ss = SessionState.get(); try { ss.loadReloadableAuxJars(); } catch (IOException e) { LOG.error("fail to reload auxiliary jar files", e); return CommandProcessorResponse.create(e); } return new CommandProcessorResponse(0); } }
private CommandProcessorResponse createProcessorResponse(int ret) { SessionState.getPerfLogger().cleanupPerfLogMetrics(); queryDisplay.setErrorMessage(errorMessage); return new CommandProcessorResponse(ret, errorMessage, SQLState, downstreamError); }
@Override public CommandProcessorResponse run(String command) { String[] args = command.split("\\s+"); if (args.length < 1) { return returnErrorResponse("Command arguments are empty."); } if (encryptionShim == null) { return returnErrorResponse("Hadoop encryption shim is not initialized."); } String action = args[0]; String params[] = Arrays.copyOfRange(args, 1, args.length); try { if (action.equalsIgnoreCase("create_key")) { createEncryptionKey(params); } else if (action.equalsIgnoreCase("create_zone")) { createEncryptionZone(params); } else if (action.equalsIgnoreCase("delete_key")) { deleteEncryptionKey(params); } else { return returnErrorResponse("Unknown command action: " + action); } } catch (Exception e) { return returnErrorResponse(e.getMessage()); } return new CommandProcessorResponse(0); }
public CommandProcessorResponse run(String command) { CommandProcessorResponse cpr = null; cpr = driver.run(command); SessionState ss = SessionState.get(); if (cpr.getResponseCode() == 0) { // Only attempt to do this, if cmd was successful. // FIXME: it would be probably better to move this to an after-execution int rc = setFSPermsNGrp(ss, driver.getConf()); cpr = new CommandProcessorResponse(rc); } // reset conf vars ss.getConf().set(HCatConstants.HCAT_CREATE_DB_NAME, ""); ss.getConf().set(HCatConstants.HCAT_CREATE_TBL_NAME, ""); return cpr; }