Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 003D2200C70 for ; Thu, 4 May 2017 12:29:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F2E34160BC4; Thu, 4 May 2017 10:29:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EB7E3160B9F for ; Thu, 4 May 2017 12:29:04 +0200 (CEST) Received: (qmail 4138 invoked by uid 500); 4 May 2017 10:29:04 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 4128 invoked by uid 99); 4 May 2017 10:29:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 May 2017 10:29:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0C03CDFE8F; Thu, 4 May 2017 10:29:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Date: Thu, 04 May 2017 10:29:04 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] ignite git commit: IGNITE-5164: ODBC: renamed classes which is obviously common with JDBC. archived-at: Thu, 04 May 2017 10:29:06 -0000 Repository: ignite Updated Branches: refs/heads/master 7f8a43090 -> c7f09d8a3 http://git-wip-us.apache.org/repos/asf/ignite/blob/c7f09d8a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryCloseRequest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryCloseRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryCloseRequest.java new file mode 100644 index 0000000..74361c6 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryCloseRequest.java @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.odbc; + +import org.apache.ignite.internal.util.typedef.internal.S; + +/** + * SQL listener query close request. + */ +public class SqlListenerQueryCloseRequest extends SqlListenerRequest { + /** Query ID. */ + private final long queryId; + + /** + * @param queryId Query ID. + */ + public SqlListenerQueryCloseRequest(long queryId) { + super(QRY_CLOSE); + + this.queryId = queryId; + } + + /** + * @return Query ID. + */ + public long queryId() { + return queryId; + } + + /** {@inheritDoc} */ + @Override public String toString() { + return S.toString(SqlListenerQueryCloseRequest.class, this); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c7f09d8a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryCloseResult.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryCloseResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryCloseResult.java new file mode 100644 index 0000000..2558a85 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryCloseResult.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.odbc; + +/** + * SQL listener query close result. + */ +public class SqlListenerQueryCloseResult { + /** Query ID. */ + private final long queryId; + + /** + * @param queryId Query ID. + */ + public SqlListenerQueryCloseResult(long queryId){ + this.queryId = queryId; + } + + /** + * @return Query ID. + */ + public long getQueryId() { + return queryId; + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c7f09d8a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryExecuteRequest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryExecuteRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryExecuteRequest.java new file mode 100644 index 0000000..3c77e06 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryExecuteRequest.java @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.odbc; + +import org.apache.ignite.internal.util.tostring.GridToStringExclude; +import org.apache.ignite.internal.util.tostring.GridToStringInclude; +import org.apache.ignite.internal.util.typedef.internal.S; +import org.jetbrains.annotations.Nullable; + +/** + * SQL listener query execute request. + */ +public class SqlListenerQueryExecuteRequest extends SqlListenerRequest { + /** Cache name. */ + private final String cacheName; + + /** Sql query. */ + @GridToStringInclude(sensitive = true) + private final String sqlQry; + + /** Sql query arguments. */ + @GridToStringExclude + private final Object[] args; + + /** + * @param cacheName Cache name. + * @param sqlQry SQL query. + * @param args Arguments list. + */ + public SqlListenerQueryExecuteRequest(String cacheName, String sqlQry, Object[] args) { + super(QRY_EXEC); + + this.cacheName = cacheName.isEmpty() ? null : cacheName; + this.sqlQry = sqlQry; + this.args = args; + } + + /** + * @return Sql query. + */ + public String sqlQuery() { + return sqlQry; + } + + /** + * @return Sql query arguments. + */ + public Object[] arguments() { + return args; + } + + /** + * @return Cache name. + */ + @Nullable public String cacheName() { + return cacheName; + } + + /** {@inheritDoc} */ + @Override public String toString() { + return S.toString(SqlListenerQueryExecuteRequest.class, this, "args", args, true); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c7f09d8a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryExecuteResult.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryExecuteResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryExecuteResult.java new file mode 100644 index 0000000..e4c0cb9 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryExecuteResult.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.odbc; + +import java.util.Collection; + +/** + * SQL listener query execute result. + */ +public class SqlListenerQueryExecuteResult { + /** Query ID. */ + private final long queryId; + + /** Fields metadata. */ + private final Collection columnsMeta; + + /** + * @param queryId Query ID. + * @param columnsMeta Columns metadata. + */ + public SqlListenerQueryExecuteResult(long queryId, Collection columnsMeta) { + this.queryId = queryId; + this.columnsMeta = columnsMeta; + } + + /** + * @return Query ID. + */ + public long getQueryId() { + return queryId; + } + + /** + * @return Columns metadata. + */ + public Collection getColumnsMetadata() { + return columnsMeta; + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c7f09d8a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryFetchRequest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryFetchRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryFetchRequest.java new file mode 100644 index 0000000..41c3be0 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryFetchRequest.java @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.odbc; + +import org.apache.ignite.internal.util.typedef.internal.S; + +/** + * SQL listener query fetch request. + */ +public class SqlListenerQueryFetchRequest extends SqlListenerRequest { + /** Query ID. */ + private final long queryId; + + /** Page size - maximum number of rows to return. */ + private final int pageSize; + + /** + * @param queryId Query ID. + * @param pageSize Page size. + */ + public SqlListenerQueryFetchRequest(long queryId, int pageSize) { + super(QRY_FETCH); + + this.queryId = queryId; + this.pageSize = pageSize; + } + + /** + * @return Page size. + */ + public int pageSize() { + return pageSize; + } + + /** + * @return Query ID. + */ + public long queryId() { + return queryId; + } + + /** {@inheritDoc} */ + @Override public String toString() { + return S.toString(SqlListenerQueryFetchRequest.class, this); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c7f09d8a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryFetchResult.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryFetchResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryFetchResult.java new file mode 100644 index 0000000..6763f8b --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerQueryFetchResult.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.odbc; + +import java.util.Collection; + +/** + * SQL listener query fetch result. + */ +public class SqlListenerQueryFetchResult { + /** Query ID. */ + private final long queryId; + + /** Query result rows. */ + private final Collection items; + + /** Flag indicating the query has no unfetched results. */ + private final boolean last; + + /** + * @param queryId Query ID. + * @param items Query result rows. + * @param last Flag indicating the query has no unfetched results. + */ + public SqlListenerQueryFetchResult(long queryId, Collection items, boolean last){ + this.queryId = queryId; + this.items = items; + this.last = last; + } + + /** + * @return Query ID. + */ + public long queryId() { + return queryId; + } + + /** + * @return Query result rows. + */ + public Collection items() { + return items; + } + + /** + * @return Flag indicating the query has no unfetched results. + */ + public boolean last() { + return last; + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c7f09d8a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java new file mode 100644 index 0000000..96f24c8 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.odbc; + +/** + * SQL listener command request. + */ +public class SqlListenerRequest { + /** Handshake request. */ + public static final int HANDSHAKE = 1; + + /** Execute sql query. */ + public static final int QRY_EXEC = 2; + + /** Fetch query results. */ + public static final int QRY_FETCH = 3; + + /** Close query. */ + public static final int QRY_CLOSE = 4; + + /** Get columns meta query. */ + public static final int META_COLS = 5; + + /** Get columns meta query. */ + public static final int META_TBLS = 6; + + /** Get parameters meta. */ + public static final int META_PARAMS = 7; + + /** Command. */ + private final int cmd; + + /** + * @param cmd Command type. + */ + public SqlListenerRequest(int cmd) { + this.cmd = cmd; + } + + /** + * @return Command. + */ + public int command() { + return cmd; + } +}