Skip to content

Commit

Permalink
Initial clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunal Khatua authored and kkhatua committed May 17, 2019
1 parent 40ba8a4 commit 77e3c3c
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public void run() throws Exception {
Runtime.getRuntime().addShutdownHook(shutdownHook);
gracefulShutdownThread.start();

// Launch an archiving job that is # files and time bound
// Launch an archiving job that is limited by # files (so as to be timebound)
PersistentStore<QueryProfile> queryProfileStore = drillbitContext.getProfileStoreContext().getCompletedProfileStore();
if (queryProfileStore instanceof LocalPersistentStore
&& context.getConfig().getBoolean(ExecConstants.PROFILES_STORE_INDEX_ENABLED)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public ProfileIndexer(ClusterCoordinator coord, DrillbitContext context) throws
this.sysFileSuffixFilter = new DrillSysFilePathFilter();
String indexPathPattern = drillConfig.getString(ExecConstants.PROFILES_STORE_INDEX_FORMAT);
this.indexedPathFormat = new SimpleDateFormat(indexPathPattern);
logger.info("Organizing any existing unindexed profiles");
}


Expand Down Expand Up @@ -211,8 +210,7 @@ private long getProfileStart(Path srcPath) {
QueryProfile profile = pStoreConfig.getSerializer().deserialize(IOUtils.toByteArray(is));
return profile.getStart();
} catch (IOException e) {
logger.info("Unable to deserialize {}\n---{}====", srcPath, e.getMessage()); //Illegal character ((CTRL-CHAR, code 0)): only regular white space (\r, \n, \t) is allowed between tokens at [Source: [B@f76ca5b; line: 1, column: 65538]
logger.info("deserialization RCA==> \n {}", ExceptionUtils.getRootCause(e));
logger.error("Unable to deserialize {}\n{}", srcPath, e.getMessage());
}
return Long.MIN_VALUE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import javax.ws.rs.core.UriInfo;
import javax.xml.bind.annotation.XmlRootElement;


import org.apache.drill.common.config.DrillConfig;
import org.apache.drill.common.exceptions.DrillRuntimeException;
import org.apache.drill.common.exceptions.UserException;
Expand Down Expand Up @@ -74,7 +73,6 @@ public class ProfileResources {
public static class ProfileInfo implements Comparable<ProfileInfo> {
private static final int QUERY_SNIPPET_MAX_CHAR = 150;
private static final int QUERY_SNIPPET_MAX_LINES = 8;

public static final SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");

private final String queryId;
Expand Down Expand Up @@ -379,7 +377,7 @@ public Viewable getProfile(@PathParam("queryid") String queryId){
ProfileWrapper wrapper = new ProfileWrapper(getQueryProfile(queryId), work.getContext().getConfig());
return ViewableWithPermissions.create(authEnabled.get(), "/rest/profile/profile.ftl", sc, wrapper);
} catch (Exception | Error e) {
logger.error("Exception was thrown when fetching profile {} :\n{}\n====\n", queryId, e);
logger.error("Exception was thrown when fetching profile {} :\n{}", queryId, e);
return ViewableWithPermissions.create(authEnabled.get(), "/rest/errorMessage.ftl", sc, e);
}
}
Expand Down
Loading

0 comments on commit 77e3c3c

Please sign in to comment.