/** * Create an instance of {@link XExecution } * */ public XExecution createXExecution() { return new XExecution(); }
public XExecution withQuery(XJobQuery value) { setQuery(value); return this; }
public XExecution withSession(XSessionType value) { setSession(value); return this; }
public XExecution getXExecution(String query, String db, List<MapType> queryConfig, List<MapType> sessionConfig){ XExecution execution = new XExecution(); XJobQuery xJobQuery = new XJobQuery(); xJobQuery.setQuery(query); if (queryConfig != null){ xJobQuery.withConf(queryConfig); } XSessionType sessionType = new XSessionType(); if (db == null){ db = getCurrentDB(); } sessionType.setDb(db); if (sessionConfig != null){ sessionType.withConf(sessionConfig); } execution.setQuery(xJobQuery); execution.setSession(sessionType); return execution; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { XSessionType theSession; theSession = this.getSession(); strategy.appendField(locator, this, "session", buffer, theSession); } { XJobQuery theQuery; theQuery = this.getQuery(); strategy.appendField(locator, this, "query", buffer, theQuery); } return buffer; }
private LensConf getLensConf(XJob job, SchedulerJobInstanceHandle instanceHandle, DateTime scheduledTime) { List<MapType> jobConf = job.getExecution().getQuery().getConf(); LensConf queryConf = new LensConf(); for (MapType element : jobConf) { queryConf.addProperty(element.getKey(), element.getValue()); } queryConf.addProperty(JOB_INSTANCE_ID_KEY, instanceHandle.getHandleId()); // Current time is used for resolving date. queryConf.addProperty(LensConfConstants.QUERY_CURRENT_TIME_IN_MILLIS, scheduledTime.getMillis()); return queryConf; }
private void setSessionConf(LensSessionHandle sessionHandle, XJob job) throws LensException { XExecution execution = job.getExecution(); XSessionType executionSession = execution.getSession(); cubeMetastoreService.setCurrentDatabase(sessionHandle, executionSession.getDb()); List<MapType> sessionConfList = executionSession.getConf(); for (MapType element : sessionConfList) { sessionService.setSessionParameter(sessionHandle, element.getKey(), element.getValue()); } List<ResourcePath> resourceList = executionSession.getResourcePath(); for (ResourcePath path : resourceList) { sessionService.addResource(sessionHandle, path.getType(), path.getPath()); } }
public String toString() { final ToStringStrategy strategy = new YAMLToStringStrategy(); final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); }
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; }
public boolean equals(Object object) { final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
public int hashCode() { final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); }
private static XExecution getTestExecution(String queryString) { XExecution execution = new XExecution(); XJobQuery query = new XJobQuery(); query.setQuery(queryString); execution.setQuery(query); XSessionType sessionType = new XSessionType(); sessionType.setDb("default"); execution.setSession(sessionType); return execution; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { XSessionType theSession; theSession = this.getSession(); strategy.appendField(locator, this, "session", buffer, theSession); } { XJobQuery theQuery; theQuery = this.getQuery(); strategy.appendField(locator, this, "query", buffer, theQuery); } return buffer; }
private void checkQuery(LensSessionHandle sessionHandle, XJob job) throws LensException { List<MapType> jobConf = job.getExecution().getQuery().getConf(); LensConf queryConf = new LensConf(); for (MapType element : jobConf) { queryConf.addProperty(element.getKey(), element.getValue()); } queryConf.addProperty(CubeQueryConfUtil.FAIL_QUERY_ON_PARTIAL_DATA, false); queryService.estimate(LensServices.get().getLogSegregationContext().getLogSegragationId(), sessionHandle, job.getExecution().getQuery().getQuery(), queryConf); }
public String toString() { final ToStringStrategy strategy = new YAMLToStringStrategy(); final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); }
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; }
public boolean equals(Object object) { final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
public int hashCode() { final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); }
private XExecution getTestExecution() { XExecution execution = new XExecution(); XJobQuery query = new XJobQuery(); query.setQuery("select * from test_table"); execution.setQuery(query); XSessionType sessionType = new XSessionType(); sessionType.setDb("test"); execution.setSession(sessionType); return execution; }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof XExecution)) { return false; } if (this == object) { return true; } final XExecution that = ((XExecution) object); { XSessionType lhsSession; lhsSession = this.getSession(); XSessionType rhsSession; rhsSession = that.getSession(); if (!strategy.equals(LocatorUtils.property(thisLocator, "session", lhsSession), LocatorUtils.property(thatLocator, "session", rhsSession), lhsSession, rhsSession)) { return false; } } { XJobQuery lhsQuery; lhsQuery = this.getQuery(); XJobQuery rhsQuery; rhsQuery = that.getQuery(); if (!strategy.equals(LocatorUtils.property(thisLocator, "query", lhsQuery), LocatorUtils.property(thatLocator, "query", rhsQuery), lhsQuery, rhsQuery)) { return false; } } return true; }