private void attachMetadata(IIInstance ii) throws IOException { Configuration conf = job.getConfiguration(); attachKylinPropsAndMetadata(ii, conf); IISegment seg = ii.getFirstSegment(); conf.set(BatchConstants.CFG_II_NAME, ii.getName()); conf.set(BatchConstants.CFG_II_SEGMENT_NAME, seg.getName()); }
public void removeIICache(IIInstance ii) { iiMap.remove(ii.getName()); for (IISegment segment : ii.getSegments()) { usedStorageLocation.remove(segment.getName()); } }
private IIJob initialJob(IISegment seg, String type) { IIJob result = new IIJob(); SimpleDateFormat format = new SimpleDateFormat("z yyyy-MM-dd HH:mm:ss"); format.setTimeZone(TimeZone.getTimeZone(engineConfig.getTimeZone())); result.setIIName(seg.getIIInstance().getName()); result.setSegmentId(seg.getUuid()); result.setName(seg.getIIInstance().getName() + " - " + seg.getName() + " - " + type + " - " + format.format(new Date(System.currentTimeMillis()))); result.setSubmitter(this.submitter); return result; }
private synchronized IIInstance loadIIInstance(String path) throws IOException { ResourceStore store = getStore(); logger.debug("Loading IIInstance " + store.getReadableResourcePath(path)); IIInstance IIInstance = null; try { IIInstance = store.getResource(path, IIInstance.class, II_SERIALIZER); IIInstance.setConfig(config); if (StringUtils.isBlank(IIInstance.getName())) throw new IllegalStateException("IIInstance name must not be blank"); iiMap.putLocal(IIInstance.getName(), IIInstance); for (IISegment segment : IIInstance.getSegments()) { usedStorageLocation.add(segment.getName()); } return IIInstance; } catch (Exception e) { logger.error("Error during load ii instance " + path, e); return null; } }
private void attachMetadata(IIInstance ii) throws IOException { Configuration conf = job.getConfiguration(); attachKylinPropsAndMetadata(ii, conf); IISegment seg = ii.getFirstSegment(); conf.set(BatchConstants.CFG_II_NAME, ii.getName()); conf.set(BatchConstants.CFG_II_SEGMENT_NAME, seg.getName()); }
private IIJob initialJob(IISegment seg, String type) { IIJob result = new IIJob(); SimpleDateFormat format = new SimpleDateFormat("z yyyy-MM-dd HH:mm:ss"); format.setTimeZone(TimeZone.getTimeZone(engineConfig.getTimeZone())); result.setIIName(seg.getIIInstance().getName()); result.setSegmentId(seg.getUuid()); result.setName(seg.getIIInstance().getName() + " - " + seg.getName() + " - " + type + " - " + format.format(new Date(System.currentTimeMillis()))); result.setSubmitter(this.submitter); return result; }