Entry<String, QueryProfile> profileKVPair = profiles.next(); if (profileKVPair.getValue().getUser().equals(username)) { authorizedProfiles.add(profileKVPair);
final Map.Entry<String, QueryProfile> profileEntry = range.next(); final QueryProfile profile = profileEntry.getValue(); if (principal.canManageProfileOf(profile.getUser())) { finishedQueries.add( new ProfileInfo(work.getContext().getConfig(), profile.getForeman().getAddress(), profile.getQuery(), ProfileUtil.getQueryStateDisplayName(profile.getState()), profile.getUser(), profile.getTotalCost(), profile.getQueueName()));
@Nullable @Override public ProfileInfo apply(@Nullable Entry<String, UserBitShared.QueryProfile> input) { if (input == null || input.getValue() == null) { return ProfileInfo.getDefault(); } //Constructing ProfileInfo final String queryID = input.getKey(); final QueryProfile profile = input.getValue(); //For cases where query was never queued final long assumedQueueEndTime = profile.getQueueWaitEnd()> 0 ? profile.getQueueWaitEnd() : profile.getPlanEnd(); return new ProfileInfo( queryID, new Timestamp(profile.getStart()), profile.getForeman().getAddress(), profile.getTotalFragments(), profile.getUser(), profile.getQueueName(), computeDuration(profile.getStart(), profile.getPlanEnd()), computeDuration(profile.getPlanEnd(), assumedQueueEndTime), computeDuration(assumedQueueEndTime, profile.getEnd()), profile.getState().name(), profile.getQuery() ); } });
output.writeString(12, message.getUser(), false); if(message.hasError()) output.writeString(13, message.getError(), false);
/** * <code>optional string user = 12 [default = "-"];</code> */ public Builder clearUser() { bitField0_ = (bitField0_ & ~0x00000800); user_ = getDefaultInstance().getUser(); onChanged(); return this; } /**
private void checkOrThrowProfileViewAuthorization(final QueryProfile profile) { if (!principal.canManageProfileOf(profile.getUser())) { throw UserException.permissionError() .message("Not authorized to view the profile of query '%s'", profile.getId()) .build(logger); } }
output.writeString(12, message.getUser(), false); if(message.hasError()) output.writeString(13, message.getError(), false);
/** * <code>optional string user = 12 [default = "-"];</code> */ public Builder clearUser() { bitField0_ = (bitField0_ & ~0x00000800); user_ = getDefaultInstance().getUser(); onChanged(); return this; } /**