Skip to content

Commit

Permalink
TEIID-5262 removing 7.x support
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Feb 19, 2018
1 parent eefd948 commit e5f42f5
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ public void writeExternal(ObjectOutput out) throws IOException {

@Override
public String toString() {
return "Invoke " + targetClass + "." + methodName; //$NON-NLS-1$ //$NON-NLS-2$
return "Invoke " + targetClass + "." + methodName + " " + args.length ; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,8 @@ private void logon(ILogon newLogon, boolean logoff) throws LogonException, Teiid
}

if (logoff) {
if ("07.03".compareTo(this.serverInstance.getServerVersion()) <= 0) { //$NON-NLS-1$
//just remove the current instance - the server has already logged off the current user
LogonResult old = this.logonResults.remove(this.serverInstance.getHostInfo());
this.connectionFactory.disconnected(this.serverInstance, old.getSessionToken());
}
LogonResult old = this.logonResults.remove(this.serverInstance.getHostInfo());
this.connectionFactory.disconnected(this.serverInstance, old.getSessionToken());
logoffAll();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import java.util.logging.Logger;

import org.teiid.client.security.ILogon;
import org.teiid.client.security.InvalidSessionException;
import org.teiid.client.security.SessionToken;
import org.teiid.core.TeiidException;
import org.teiid.core.util.PropertiesUtils;
Expand Down Expand Up @@ -205,23 +204,12 @@ public void run() {
try {
instance = getServerInstance(entry.getKey());
ILogon logon = instance.getService(ILogon.class);
if ("07.01.01".compareTo(instance.getServerVersion()) > 0) { //$NON-NLS-1$
for (SessionToken session : entries) {
try {
logon.assertIdentity(session);
logon.ping();
log.log(Level.FINER, "issueing ping for session:", session); //$NON-NLS-1$
} catch (InvalidSessionException e) {
}
}
} else {
ArrayList<String> sessionStrings = new ArrayList<String>(entry.getValue().size());
for (SessionToken session : entries) {
sessionStrings.add(session.getSessionID());
}
logon.ping(sessionStrings);
log.log(Level.FINER, "issueing ping for sessions:", sessionStrings); //$NON-NLS-1$
ArrayList<String> sessionStrings = new ArrayList<String>(entry.getValue().size());
for (SessionToken session : entries) {
sessionStrings.add(session.getSessionID());
}
logon.ping(sessionStrings);
log.log(Level.FINER, "issueing ping for sessions:", sessionStrings); //$NON-NLS-1$
} catch (Exception e) {
log.log(Level.WARNING, "Error performing keep-alive ping", e); //$NON-NLS-1$
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ public class DQPWorkContext implements Serializable {
private static final boolean longDatesTimes = PropertiesUtils.getBooleanProperty(System.getProperties(), "org.teiid.longDatesTimes", false); //$NON-NLS-1$

public enum Version {
SEVEN_1("07.01", (byte)0), //$NON-NLS-1$
SEVEN_3("07.03", (byte)0), //$NON-NLS-1$
SEVEN_4("07.04", (byte)0), //$NON-NLS-1$
EIGHT_0("08.00", (byte)(longDatesTimes?0:1)), //$NON-NLS-1$
EIGHT_2("08.02", (byte)2), //$NON-NLS-1$
EIGHT_4("08.04.00.CR3", (byte)2), //$NON-NLS-1$
Expand Down Expand Up @@ -98,7 +95,7 @@ public String toString() {
public static Version getVersion(String version) {
Map.Entry<String, Version> v = versionMap.floorEntry(version);
if (v == null) {
return SEVEN_1;
return EIGHT_0;
}
return v.getValue();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.JDBCSQLTypeInfo;
import org.teiid.core.types.XMLType;
import org.teiid.dqp.internal.process.DQPWorkContext.Version;
import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
import org.teiid.dqp.message.RequestID;
import org.teiid.query.QueryPlugin;
Expand All @@ -51,8 +50,16 @@
import org.teiid.query.sql.lang.Query;
import org.teiid.query.sql.lang.SPParameter;
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.symbol.*;
import org.teiid.query.sql.symbol.AggregateSymbol;
import org.teiid.query.sql.symbol.AggregateSymbol.Type;
import org.teiid.query.sql.symbol.AliasSymbol;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.symbol.Symbol;
import org.teiid.query.sql.symbol.WindowFunction;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.ReferenceCollectorVisitor;
import org.teiid.query.tempdata.TempTableStore;
Expand Down Expand Up @@ -96,7 +103,6 @@ MetadataResult processMessage(RequestID requestId, DQPWorkContext workContext, S
this.requestID = requestId;

this.metadata = workContext.getVDB().getAttachment(QueryMetadataInterface.class);
this.labelAsName = workContext.getClientVersion().compareTo(Version.SEVEN_3) <= 0;

RequestWorkItem workItem = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.Map;
import java.util.Set;

import org.junit.Before;
import org.junit.Test;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
Expand All @@ -35,7 +34,6 @@
import org.teiid.client.metadata.ResultsMetadataConstants;
import org.teiid.core.types.DataTypeManager;
import org.teiid.dqp.internal.datamgr.FakeTransactionService;
import org.teiid.dqp.internal.process.DQPWorkContext.Version;
import org.teiid.dqp.message.RequestID;
import org.teiid.metadata.Column;
import org.teiid.metadata.MetadataStore;
Expand All @@ -52,12 +50,6 @@
@SuppressWarnings({"nls", "unchecked"})
public class TestMetaDataProcessor {

private boolean asLegacyClient;

@Before public void setup() {
asLegacyClient = false;
}

public Map[] helpGetMetadata(String sql, QueryMetadataInterface metadata, VDBMetaData vdb) throws Exception {
// Prepare sql
Command command = QueryParser.getQueryParser().parseCommand(sql);
Expand All @@ -69,9 +61,6 @@ public Map[] helpGetMetadata(String sql, QueryMetadataInterface metadata, VDBMet
requestMgr.setTransactionService(new FakeTransactionService());

DQPWorkContext workContext = RealMetadataFactory.buildWorkContext(metadata, vdb);
if (asLegacyClient) {
workContext.setClientVersion(Version.SEVEN_3);
}

// Initialize components
RequestID requestID = workContext.getRequestID(1);
Expand All @@ -91,15 +80,6 @@ public Map[] helpGetMetadata(String sql, QueryMetadataInterface metadata, VDBMet
assertEquals("e1", metadata[0].get(ResultsMetadataConstants.ELEMENT_LABEL)); //$NON-NLS-1$
}

@Test public void testLegacyClient() throws Exception {
asLegacyClient = true;
Map[] metadata = helpGetMetadata("SELECT e1 as e2 FROM pm1.g1", RealMetadataFactory.example1Cached(), RealMetadataFactory.example1VDB()); //$NON-NLS-1$
assertNotNull(metadata);
assertEquals(1, metadata.length);
assertEquals("e2", metadata[0].get(ResultsMetadataConstants.ELEMENT_NAME)); //$NON-NLS-1$
assertEquals("e2", metadata[0].get(ResultsMetadataConstants.ELEMENT_LABEL)); //$NON-NLS-1$
}

@Test public void testSimpleUpdate() throws Exception {
Map[] metadata = helpGetMetadata("INSERT INTO pm1.g1 (e1) VALUES ('x')", RealMetadataFactory.example1Cached(), RealMetadataFactory.example1VDB()); //$NON-NLS-1$
assertNull(metadata);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5202,11 +5202,11 @@ static void processPreparedStatement(String sql, List[] expected,
QueryMetadataInterface metadata, List<?> values) throws Exception {
Command command = helpParse(sql);
CommandContext context = createCommandContext();
context.setMetadata(metadata);
ProcessorPlan plan = helpGetPlan(command, metadata, capFinder, context);

context.setMetadata(metadata);
// Collect reference, set value
setParameterValues(values, command, context);
ProcessorPlan plan = helpGetPlan(command, metadata, capFinder, context);

// Run query
helpProcess(plan, context, dataManager, expected);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ <h4>from 10.0</h4>
<ul>
<li><a href="https://issues.jboss.org/browse/TEIID-5177">TEIID-5177</a> Stricter naming is now enforced in DDL. Only unqualified identifiers are expected as names. Set the system property org.teiid.requireUnqualifiedNames=false to restore the older behavior.</li>
<li><a href="https://issues.jboss.org/browse/TEIID-5201">TEIID-5201</a> The SYS.Keys table had SchemaUID and RefSchemaUID columns added.</li>
<li><a href="https://issues.jboss.org/browse/TEIID-5262">TEIID-5262</a> Removed support for Teiid 7.x clients/servers</li>
</ul>

<h4>from 9.3</h4>
Expand Down

0 comments on commit e5f42f5

Please sign in to comment.