@Override public void run() { try { LOG.debug("Begin parsing summary logs. "); appLogs.parseSummaryLogs(); if (appLogs.isDone()) { appLogs.moveToDone(); appIdLogMap.remove(appLogs.getAppId()); } LOG.debug("End parsing summary logs. "); } catch (Exception e) { LOG.error("Error processing logs for " + appLogs.getAppId(), e); } } }
@Override public void run() { try { LOG.debug("Begin parsing summary logs. "); appLogs.parseSummaryLogs(); if (appLogs.isDone()) { appLogs.moveToDone(); appIdLogMap.remove(appLogs.getAppId()); } LOG.debug("End parsing summary logs. "); } catch (Exception e) { Throwable t = extract(e); if (t instanceof InterruptedException) { LOG.info("Log parser interrupted"); } else { LOG.error("Error processing logs for " + appLogs.getAppId(), t); } } } }
private TimelineStore getCachedStore(TimelineEntityGroupId groupId, List<EntityCacheItem> cacheItems) throws IOException { EntityCacheItem cacheItem; synchronized (this.cachedLogs) { // Note that the content in the cache log storage may be stale. cacheItem = this.cachedLogs.get(groupId); if (cacheItem == null) { LOG.debug("Set up new cache item for id {}", groupId); cacheItem = new EntityCacheItem(groupId, getConfig()); AppLogs appLogs = getAndSetAppLogs(groupId.getApplicationId()); if (appLogs != null) { LOG.debug("Set applogs {} for group id {}", appLogs, groupId); cacheItem.setAppLogs(appLogs); this.cachedLogs.put(groupId, cacheItem); } else { LOG.warn("AppLogs for groupId {} is set to null!", groupId); } } } TimelineStore store = null; if (cacheItem.getAppLogs() != null) { AppLogs appLogs = cacheItem.getAppLogs(); LOG.debug("try refresh cache {} {}", groupId, appLogs.getAppId()); cacheItems.add(cacheItem); store = cacheItem.refreshCache(aclManager, metrics); } else { LOG.warn("AppLogs for group id {} is null", groupId); } return store; }
private TimelineStore getCachedStore(TimelineEntityGroupId groupId) throws IOException { EntityCacheItem cacheItem; synchronized (this.cachedLogs) { // Note that the content in the cache log storage may be stale. cacheItem = this.cachedLogs.get(groupId); if (cacheItem == null) { LOG.debug("Set up new cache item for id {}", groupId); cacheItem = new EntityCacheItem(getConfig(), fs); AppLogs appLogs = getAndSetAppLogs(groupId.getApplicationId()); if (appLogs != null) { LOG.debug("Set applogs {} for group id {}", appLogs, groupId); cacheItem.setAppLogs(appLogs); this.cachedLogs.put(groupId, cacheItem); } else { LOG.warn("AppLogs for groupId {} is set to null!", groupId); } } } TimelineStore store = null; if (cacheItem.getAppLogs() != null) { AppLogs appLogs = cacheItem.getAppLogs(); LOG.debug("try refresh cache {} {}", groupId, appLogs.getAppId()); store = cacheItem.refreshCache(groupId, aclManager, jsonFactory, objMapper); } else { LOG.warn("AppLogs for group id {} is null", groupId); } return store; }