drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hnfgns <...@git.apache.org>
Subject [GitHub] drill pull request: DRILL-4275: create TransientStore for short-li...
Date Mon, 15 Feb 2016 23:43:39 GMT
Github user hnfgns commented on a diff in the pull request:

    https://github.com/apache/drill/pull/374#discussion_r52954122
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
---
    @@ -146,38 +155,37 @@ public QProfiles(List<ProfileInfo> runningQueries, List<ProfileInfo>
finishedQue
       @Path("/profiles.json")
       @Produces(MediaType.APPLICATION_JSON)
       public QProfiles getProfilesJSON() {
    -    PStore<QueryProfile> completed = null;
    -    PStore<QueryInfo> running = null;
    -    try {
    -      completed = provider().getStore(QueryManager.QUERY_PROFILE);
    -      running = provider().getStore(QueryManager.RUNNING_QUERY_INFO);
    -    } catch (IOException e) {
    -      logger.debug("Failed to get profiles from persistent or ephemeral store.");
    -      return new QProfiles(new ArrayList<ProfileInfo>(), new ArrayList<ProfileInfo>());
    -    }
    -
    -    List<ProfileInfo> runningQueries = Lists.newArrayList();
    -
    -    for (Map.Entry<String, QueryInfo> entry : running) {
    -      QueryInfo profile = entry.getValue();
    -      if (principal.canManageProfileOf(profile.getUser())) {
    -        runningQueries.add(new ProfileInfo(entry.getKey(), profile.getStart(), profile.getForeman().getAddress(),
    -            profile.getQuery(), profile.getState().name(), profile.getUser()));
    +    try (
    +        final PersistentStore<QueryProfile> completed = getProvider().getStore(QueryManager.QUERY_PROFILE);
    +        final TransientStore<QueryInfo> running = getCoordinator().newTransientStore(QueryManager.RUNNING_QUERY_INFO);
    --- End diff --
    
    nope instances are now cached. I will rename the method to reflect that change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message