commit a5ee4ba44d9265bf09ca34b480dccf4f5813c194 Author: Devendra Vishwakarma Date: Thu Feb 4 05:43:47 2016 -0800 Fixing missing javadocs which were causing Hive release build failure with IBM Jdk 1.8 as per RTC no 115836 diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java index 062d5a0..dd146cf 100644 --- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java +++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java @@ -347,9 +347,10 @@ public String amMemoryMb() { return get(MR_AM_MEMORY_MB); } - /** - * @see #HIVE_PROPS_NAME - */ + /** + * @see #HIVE_PROPS_NAME + * @return Returns list of hive properties + */ public Collection hiveProps() { String[] props= StringUtils.split(get(HIVE_PROPS_NAME)); //since raw data was (possibly) escaped to make split work, diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/ColumnDesc.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/ColumnDesc.java index f1b4975..3aa2fb3 100644 --- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/ColumnDesc.java +++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/ColumnDesc.java @@ -31,9 +31,16 @@ public ColumnDesc() {} - /** - * Create a new ColumnDesc - */ + /** + * Create a new ColumnDesc + * + * @param name + * Name of the column + * @param type + * Type of the column + * @param comment + * Comment of the column + */ public ColumnDesc(String name, String type, String comment) { this.name = name; this.type = type; diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/CompleteDelegator.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/CompleteDelegator.java index e3be5b7..66a66a4 100644 --- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/CompleteDelegator.java +++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/CompleteDelegator.java @@ -116,11 +116,18 @@ public CompleteBean run(String id, String jobStatus) } } - /** - * Call the callback url with the jobid to let them know it's - * finished. If the url has the string $jobId in it, it will be - * replaced with the completed jobid. - */ + /** + * Call the callback url with the jobid to let them know it's finished. If + * the url has the string $jobId in it, it will be replaced with the + * completed jobid. + * + * @param jobid + * Id of the Job + * @param url + * Url of the Job + * @throws IOException + * if stream cannot be written to or closed. + */ public static void doCallback(String jobid, String url) throws IOException { if (url.contains("$jobId")) url = url.replace("$jobId", jobid); diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/ExecServiceImpl.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/ExecServiceImpl.java index a919079..fa4ab15 100644 --- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/ExecServiceImpl.java +++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/ExecServiceImpl.java @@ -86,9 +86,11 @@ public void run() /** Windows CreateProcess synchronization object */ private static final Object WindowsProcessLaunchLock = new Object(); - /** - * Retrieve the singleton. - */ + /** + * Retrieve the singleton. + * + * @return the singleton + */ public static synchronized ExecServiceImpl getInstance() { if (theSingleton == null) { theSingleton = new ExecServiceImpl(); @@ -255,11 +257,12 @@ private CommandLine makeCommandLine(String program, return cmd; } - /** - * Build the environment used for all exec calls. - * - * @return The environment variables. - */ + /** + * Build the environment used for all exec calls. + * + * @param env the environment to build + * @return The environment variables. + */ public Map execEnv(Map env) { HashMap res = new HashMap(); @@ -277,13 +280,18 @@ private CommandLine makeCommandLine(String program, return res; } - /** - * Given a program name, lookup the fully qualified path. Throws - * an exception if the program is missing or not authorized. - * - * @param path The path of the program. - * @return The path of the validated program. - */ + /** + * Given a program name, lookup the fully qualified path. Throws an + * exception if the program is missing or not authorized. + * + * @param path + * the path of the program. + * @return the path of the validated program. + * @throws NotAuthorizedException + * if program is not authorized + * @throws IOException + * if the program is missing + */ public String validateProgram(String path) throws NotAuthorizedException, IOException { File f = new File(path); diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java index 8a4758c..0a3d6f6 100644 --- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java +++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java @@ -51,9 +51,29 @@ public HcatDelegator(AppConfig appConf, ExecService execService) { this.execService = execService; } - /** - * Run the local hcat executable. - */ + /** + * Run the local hcat executable. + * + * @param user + * name of the user + * @param exec + * executable program + * @param format + * program format + * @param group + * user group + * @param permissions + * user permissions + * @return environment + * @throws NotAuthorizedException + * if program is not authorized + * @throws BusyException + * if BusyException is thrown + * @throws ExecuteException + * if not able to execute the command + * @throws IOException + * if program is mission + */ public ExecBean run(String user, String exec, boolean format, String group, String permissions) throws NotAuthorizedException, BusyException, ExecuteException, IOException { @@ -117,9 +137,27 @@ public ExecBean run(String user, String exec, boolean format, return args; } - /** - * Return a json description of the database. - */ + /** + * Return a json description of the database. + * + * @param user + * name of the user + * @param db + * name of the db + * @param extended + * boolean value if db needs to extended + * @return response with json information + * @throws HcatException + * if unable to describe database + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response descDatabase(String user, String db, boolean extended) throws HcatException, NotAuthorizedException, BusyException, ExecuteException, IOException { @@ -136,10 +174,26 @@ public Response descDatabase(String user, String db, boolean extended) } } - /** - * Return a json "show databases like". This will return a list of - * databases. - */ + /** + * Return a json "show databases like". This will return a list of + * databases. + * + * @param user + * name of the user + * @param dbPattern + * pattern of db + * @return response with json information + * @throws HcatException + * if unable to show databases + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response listDatabases(String user, String dbPattern) throws HcatException, NotAuthorizedException, BusyException, ExecuteException, IOException { @@ -154,9 +208,25 @@ public Response listDatabases(String user, String dbPattern) } } - /** - * Create a database with the given name - */ + /** + * Create a database with the given name + * + * @param user + * name of the user + * @param desc + * database description + * @return response with json information + * @throws HcatException + * if unable to create databases + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response createDatabase(String user, DatabaseDesc desc) throws HcatException, NotAuthorizedException, BusyException, ExecuteException, IOException { @@ -179,9 +249,33 @@ public Response createDatabase(String user, DatabaseDesc desc) .build(); } - /** - * Drop the given database - */ + /** + * Drop the given database + * + * @param user + * name of the user + * @param db + * database name + * @param ifExists + * boolean if database exists + * @param option + * options needed + * @param group + * user group + * @param permissions + * user permissions + * @return reponse with json information + * @throws HcatException + * if unable to drop databases + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response dropDatabase(String user, String db, boolean ifExists, String option, String group, String permissions) @@ -201,9 +295,27 @@ public Response dropDatabase(String user, String db, .build(); } - /** - * Create a table. - */ + /** + * Create a table. + * + * @param user + * username + * @param db + * database name + * @param desc + * database description + * @return reponse with json information + * @throws HcatException + * if unable to create table + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response createTable(String user, String db, TableDesc desc) throws HcatException, NotAuthorizedException, BusyException, ExecuteException, IOException { @@ -222,9 +334,27 @@ public Response createTable(String user, String db, TableDesc desc) } } - /** - * Create a table like another. - */ + /** + * Create a table like another. + * + * @param user + * username + * @param db + * database name + * @param desc + * database description + * @return response with json information + * @throws HcatException + * if unable to create table + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response createTableLike(String user, String db, TableLikeDesc desc) throws HcatException, NotAuthorizedException, BusyException, ExecuteException, IOException { @@ -250,9 +380,29 @@ public Response createTableLike(String user, String db, TableLikeDesc desc) } } - /** - * Return a json description of the table. - */ + /** + * Return a json description of the table. + * + * @param user + * username + * @param db + * database name + * @param table + * table name + * @param extended + * boolean value if database is extended + * @return response with json information + * @throws HcatException + * if unable to describe table + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response descTable(String user, String db, String table, boolean extended) throws HcatException, NotAuthorizedException, BusyException, ExecuteException, IOException { @@ -273,10 +423,27 @@ public Response descTable(String user, String db, String table, boolean extended } } - /** - * Return a json "show table like". This will return a list of - * tables. - */ + /** + * Return a json "show table like". This will return a list of tables. + * + * @param user + * username + * @param db + * database name + * @param tablePattern + * table pattern + * @return response with json information + * @throws HcatException + * if unable to list tables + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response listTables(String user, String db, String tablePattern) throws HcatException, NotAuthorizedException, BusyException, ExecuteException, IOException { @@ -293,10 +460,28 @@ public Response listTables(String user, String db, String tablePattern) } } - /** - * Return a json "show table extended like" with extra info from "desc exteded" - * This will return table with exact name match. - */ + /** + * Return a json "show table extended like" with extra info from + * "desc exteded" This will return table with exact name match. + * + * @param user + * username + * @param db + * database name + * @param table + * table name + * @return response with json information + * @throws HcatException + * if unable to show tables + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response descExtendedTable(String user, String db, String table) throws HcatException, NotAuthorizedException, BusyException, ExecuteException, IOException { @@ -492,9 +677,34 @@ private String singleTable(String json, String table) } } - /** - * Drop a table. - */ + /** + * Drop a table. + * + * @param user + * username + * @param db + * database name + * @param table + * table name + * @param ifExists + * boolean if table exists + * @param group + * groupname + * @param permissions + * user permissions + * @return response with json information + * @return response with json information + * @throws HcatException + * if unable to drop tables + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response dropTable(String user, String db, String table, boolean ifExists, String group, String permissions) @@ -516,9 +726,33 @@ public Response dropTable(String user, String db, } } - /** - * Rename a table. - */ + /** + * Rename a table. + * + * @param user + * username + * @param db + * database name + * @param oldTable + * old table name + * @param newTable + * new table name + * @param group + * user group + * @param permissions + * user permissions + * @return response with json information + * @throws HcatException + * if unable to rename tables + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response renameTable(String user, String db, String oldTable, String newTable, String group, String permissions) @@ -538,9 +772,29 @@ public Response renameTable(String user, String db, } } - /** - * Describe one table property. - */ + /** + * Describe one table property. + * + * @param user + * username + * @param db + * database name + * @param table + * table name + * @param property + * properties + * @return response with json information + * @throws HcatException + * if unable to desc tables properties + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response descTableProperty(String user, String db, String table, String property) throws HcatException, NotAuthorizedException, BusyException, @@ -565,9 +819,27 @@ public Response descTableProperty(String user, String db, .build(); } - /** - * List the table properties. - */ + /** + * List the table properties. + * + * @param user + * username + * @param db + * database name + * @param table + * table name + * @return response with json information + * @throws HcatException + * if unable to list tables properties + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response listTableProperties(String user, String db, String table) throws HcatException, NotAuthorizedException, BusyException, ExecuteException, IOException { @@ -582,9 +854,29 @@ public Response listTableProperties(String user, String db, String table) .build(); } - /** - * Add one table property. - */ + /** + * Add one table property. + * + * @param user + * username + * @param db + * database name + * @param table + * table name + * @param desc + * table properties + * @return response with json information + * @throws HcatException + * if unable to add tables properties + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response addOneTableProperty(String user, String db, String table, TablePropertyDesc desc) throws HcatException, NotAuthorizedException, BusyException, @@ -616,9 +908,27 @@ private Map tableProperties(Object extendedTable) { return (Map) tableInfo.get("parameters"); } - /** - * Return a json description of the partitions. - */ + /** + * Return a json description of the partitions. + * + * @param user + * username + * @param db + * database name + * @param table + * table name + * @return response with json information + * @throws HcatException + * if unable to list partitions + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response listPartitions(String user, String db, String table) throws HcatException, NotAuthorizedException, BusyException, ExecuteException, IOException { @@ -636,9 +946,29 @@ public Response listPartitions(String user, String db, String table) } } - /** - * Return a json description of one partition. - */ + /** + * Return a json description of one partition. + * + * @param user + * username + * @param db + * database name + * @param table + * table name + * @param partition + * partition name + * @return response with json information + * @throws HcatException + * if unable to describe partition + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response descOnePartition(String user, String db, String table, String partition) throws HcatException, NotAuthorizedException, BusyException, @@ -676,9 +1006,29 @@ public Response descOnePartition(String user, String db, String table, } } - /** - * Add one partition. - */ + /** + * Add one partition. + * + * @param user + * username + * @param db + * database name + * @param table + * table name + * @param desc + * table properties + * @return response with json information + * @throws HcatException + * if unable to add one partition + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response addOnePartition(String user, String db, String table, PartitionDesc desc) throws HcatException, NotAuthorizedException, BusyException, @@ -712,9 +1062,35 @@ public Response addOnePartition(String user, String db, String table, } } - /** - * Drop a partition. - */ + /** + * Drop a partition. + * + * @param user + * username + * @param db + * database name + * @param table + * table name + * @param partition + * partition name + * @param ifExists + * boolean if partition exists + * @param group + * user group + * @param permissions + * user permissions + * @return response with json information + * @throws HcatException + * if unable to drop partition + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response dropPartition(String user, String db, String table, String partition, boolean ifExists, String group, String permissions) @@ -738,10 +1114,27 @@ public Response dropPartition(String user, String db, } } - /** - * Return a json description of the columns. Same as - * describeTable. - */ + /** + * Return a json description of the columns. Same as describeTable. + * + * @param user + * username + * @param db + * database name + * @param table + * table name + * @return response with json information + * @throws HcatException + * if unable to list columns + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response listColumns(String user, String db, String table) throws HcatException, NotAuthorizedException, BusyException, ExecuteException, IOException { @@ -753,9 +1146,29 @@ public Response listColumns(String user, String db, String table) } } - /** - * Return a json description of one column. - */ + /** + * Return a json description of one column. + * + * @param user + * user name + * @param db + * database name + * @param table + * table name + * @param column + * colunm name + * @return response with json information + * @throws SimpleWebException + * if web exception is thrown + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response descOneColumn(String user, String db, String table, String column) throws SimpleWebException, NotAuthorizedException, BusyException, ExecuteException, IOException { @@ -792,9 +1205,29 @@ public Response descOneColumn(String user, String db, String table, String colum return Response.fromResponse(res).entity(fields).build(); } - /** - * Add one column. - */ + /** + * Add one column. + * + * @param user + * username + * @param db + * database name + * @param table + * table name + * @param desc + * table properties + * @return response with json information + * @throws HcatException + * if unable to show tables + * @throws NotAuthorizedException + * if user is not authorized + * @throws BusyException + * if db is busy or locked + * @throws ExecuteException + * if unable to execute query + * @throws IOException + * if io related exception is thrown + */ public Response addOneColumn(String user, String db, String table, ColumnDesc desc) throws HcatException, NotAuthorizedException, BusyException, @@ -870,4 +1303,4 @@ private String jsonRun(String user, String exec, ExecuteException, IOException { return jsonRun(user, exec, group, permissions, false); } -} +} \ No newline at end of file diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Server.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Server.java index 27b8e38..29a0086 100644 --- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Server.java +++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Server.java @@ -916,51 +916,69 @@ public QueueStatusBean deleteJobId(@PathParam("jobid") String jobid) return d.run(getDoAsUser(), jobid); } - /** - * Return all the known job ids for this user based on the optional filter conditions. - *

- * Example usages: - * 1. curl -s 'http://localhost:50111/templeton/v1/jobs?user.name=hsubramaniyan' - * Return all the Job IDs submitted by hsubramaniyan - * 2. curl -s - * 'http://localhost:50111/templeton/v1/jobs?user.name=hsubramaniyan&showall=true' - * Return all the Job IDs that are visible to hsubramaniyan - * 3. curl -s - * 'http://localhost:50111/templeton/v1/jobs?user.name=hsubramaniyan&jobid=job_201312091733_0003' - * Return all the Job IDs for hsubramaniyan after job_201312091733_0003. - * 4. curl -s 'http://localhost:50111/templeton/v1/jobs? - * user.name=hsubramaniyan&jobid=job_201312091733_0003&numrecords=5' - * Return the first 5(atmost) Job IDs submitted by hsubramaniyan after job_201312091733_0003. - * 5. curl -s - * 'http://localhost:50111/templeton/v1/jobs?user.name=hsubramaniyan&numrecords=5' - * Return the first 5(atmost) Job IDs submitted by hsubramaniyan after sorting the Job ID list - * lexicographically. - *

- *

- * Supporting pagination using "jobid" and "numrecords" parameters: - * Step 1: Get the start "jobid" = job_xxx_000, "numrecords" = n - * Step 2: Issue a curl command by specifying the user-defined "numrecords" and "jobid" - * Step 3: If list obtained from Step 2 has size equal to "numrecords", retrieve the list's - * last record and get the Job Id of the last record as job_yyy_k, else quit. - * Step 4: set "jobid"=job_yyy_k and go to step 2. - *

- * @param fields If "fields" set to "*", the request will return full details of the job. - * If "fields" is missing, will only return the job ID. Currently the value can only - * be "*", other values are not allowed and will throw exception. - * @param showall If "showall" is set to "true", the request will return all jobs the user - * has permission to view, not only the jobs belonging to the user. - * @param jobid If "jobid" is present, the records whose Job Id is lexicographically greater - * than "jobid" are only returned. For example, if "jobid" = "job_201312091733_0001", - * the jobs whose Job ID is greater than "job_201312091733_0001" are returned. The number of - * records returned depends on the value of "numrecords". - * @param numrecords If the "jobid" and "numrecords" parameters are present, the top #numrecords - * records appearing after "jobid" will be returned after sorting the Job Id list - * lexicographically. - * If "jobid" parameter is missing and "numrecords" is present, the top #numrecords will - * be returned after lexicographically sorting the Job Id list. If "jobid" parameter is present - * and "numrecords" is missing, all the records whose Job Id is greater than "jobid" are returned. - * @return list of job items based on the filter conditions specified by the user. - */ + /** + * Return all the known job ids for this user based on the optional filter + * conditions. + *

+ * Example usages: 1. curl -s 'http://localhost:50111/templeton/v1/jobs?user.name=hsubramaniyan' + * Return all the Job IDs submitted by hsubramaniyan + * 2. curl -s 'http://localhost:50111/templeton/v1/jobs?user.name=hsubramaniyan&showall=true' + * Return all the Job IDs that are visible to hsubramaniyan + * 3. curl -s 'http://localhost:50111/templeton/v1/jobs?user.name=hsubramaniyan&jobid=job_201312091733_0003' + * Return all the Job IDs for hsubramaniyan after job_201312091733_0003. + * 4. curl -s 'http://localhost:50111/templeton/v1/jobs? + * user.name=hsubramaniyan&jobid=job_201312091733_0003&numrecords=5' + * Return the first 5(atmost) Job IDs submitted by hsubramaniyan after job_201312091733_0003. + * 5. curl -s + * 'http://localhost:50111/templeton/v1/jobs?user.name=hsubramaniyan&numrecords=5' + * Return the first 5(atmost) Job IDs submitted by hsubramaniyan after sorting the Job ID list + * lexicographically. + *

+ *

+ * Supporting pagination using "jobid" and "numrecords" parameters: Step 1: + * Get the start "jobid" = job_xxx_000, "numrecords" = n Step 2: Issue a + * curl command by specifying the user-defined "numrecords" and "jobid" Step + * 3: If list obtained from Step 2 has size equal to "numrecords", retrieve + * the list's last record and get the Job Id of the last record as + * job_yyy_k, else quit. Step 4: set "jobid"=job_yyy_k and go to step 2. + *

+ * + * @param fields + * If "fields" set to "*", the request will return full details + * of the job. If "fields" is missing, will only return the job + * ID. Currently the value can only be "*", other values are not + * allowed and will throw exception. + * @param showall + * If "showall" is set to "true", the request will return all + * jobs the user has permission to view, not only the jobs + * belonging to the user. + * @param jobid + * If "jobid" is present, the records whose Job Id is + * lexicographically greater than "jobid" are only returned. For + * example, if "jobid" = "job_201312091733_0001", the jobs whose + * Job ID is greater than "job_201312091733_0001" are returned. + * The number of records returned depends on the value of + * "numrecords". + * @param numrecords + * If the "jobid" and "numrecords" parameters are present, the + * top #numrecords records appearing after "jobid" will be + * returned after sorting the Job Id list lexicographically. If + * "jobid" parameter is missing and "numrecords" is present, the + * top #numrecords will be returned after lexicographically + * sorting the Job Id list. If "jobid" parameter is present and + * "numrecords" is missing, all the records whose Job Id is + * greater than "jobid" are returned. + * @return list of job items based on the filter conditions specified by the + * user. + * @throws NotAuthorizedException + * if user is not authorized + * @throws BadParam + * if any bad parameter + * @throws IOException + * if any io related excpetion is thrown + * @throws InterruptedException + * if threas is interrupted + */ @GET @Path("jobs") @Produces({MediaType.APPLICATION_JSON}) diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonStorage.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonStorage.java index cf27ffa..3faa3bd 100644 --- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonStorage.java +++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonStorage.java @@ -89,12 +89,13 @@ public void saveField(Type type, String id, String key, String val) */ public boolean delete(Type type, String id) throws NotFoundException; - /** - * Get the id of each data grouping of a given type in the storage - * system. - * @param type The data type (as listed above) - * @return An ArrayList of ids. - */ + /** + * Get the id of each data grouping of a given type in the storage system. + * + * @param type + * The data type (as listed above) + * @return An String ArrayList of ids. + */ public List getAllForType(Type type); /** diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/ZooKeeperCleanup.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/ZooKeeperCleanup.java index 24336e2..7cd6b94 100644 --- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/ZooKeeperCleanup.java +++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/ZooKeeperCleanup.java @@ -59,10 +59,12 @@ // Whether the cycle is running private static boolean isRunning = false; - /** - * Create a cleanup object. We use the appConfig to configure JobState. - * @param appConf - */ + /** + * Create a cleanup object. We use the appConfig to configure JobState. + * + * @param appConf + * the appConfig to configure JobState + */ private ZooKeeperCleanup(Configuration appConf) { this.appConf = appConf; interval = appConf.getLong(ZK_CLEANUP_INTERVAL, interval); @@ -83,11 +85,11 @@ public static void startInstance(Configuration appConf) throws IOException { } } - /** - * Run the cleanup loop. - * - * @throws IOException - */ + /** + * Run the cleanup loop. (non-Javadoc) + * + * @see java.lang.Thread#run() + */ public void run() { CuratorFramework zk = null; List nodes = null; @@ -129,11 +131,13 @@ public void run() { isRunning = false; } - /** - * Get the list of jobs from JobState - * - * @throws IOException - */ + /** + * Get the list of jobs from JobState + * + * @param zk + * zookeeper framework + * @return the job + */ public List getChildList(CuratorFramework zk) { try { List jobs = JobStateTracker.getTrackingJobs(appConf, zk); @@ -145,9 +149,15 @@ public void run() { return new ArrayList(); } - /** - * Check to see if a job is more than maxage old, and delete it if so. - */ + /** + * Check to see if a job is more than maxage old, and delete it if so. + * + * @param node + * nodename + * @param zk + * zookeeper framework + * @return true if job deleted + */ public boolean checkAndDelete(String node, CuratorFramework zk) { JobState state = null; try {