[
https://issues.apache.org/jira/browse/METAMODEL-18?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14157893#comment-14157893
]
ASF GitHub Bot commented on METAMODEL-18:
-----------------------------------------
Github user albertostratio commented on a diff in the pull request:
https://github.com/apache/incubator-metamodel/pull/2#discussion_r18390544
--- Diff:
cassandra/src/main/java/org/apache/metamodel/cassandra/CassandraDataSet.java ---
@@ -0,0 +1,83 @@
+/**
+ * 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.metamodel.cassandra;
+
+
+import org.apache.metamodel.data.AbstractDataSet;
+import org.apache.metamodel.data.Row;
+import org.apache.metamodel.schema.Column;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Iterator;
+
+final class CassandraDataSet extends AbstractDataSet {
+
+ private static final Logger logger =
LoggerFactory.getLogger(CassandraDataSet.class);
+
+ private final Iterator<com.datastax.driver.core.Row> _cursor;
+ private final boolean _queryPostProcessed;
+
+ private boolean _closed;
+ private volatile com.datastax.driver.core.Row _dbObject;
+
+ public CassandraDataSet(Iterator<com.datastax.driver.core.Row> cursor,
Column[] columns, boolean queryPostProcessed) {
+ super(columns);
+ _cursor = cursor;
+ _queryPostProcessed = queryPostProcessed;
+ _closed = false;
+ }
+
+ public boolean isQueryPostProcessed() {
+ return _queryPostProcessed;
+ }
+
+ @Override
+ public void close() {
+ super.close();
+ _closed = true;
--- End diff --
At first the DataSet constructor received the ResultSet instead of the
Iterator because I thought the ResultSet was closeable, when I find out that
is not I decided to pass in the iterator and simply do nothing within the close
method.
> Cassandra DB support for MetaModel
> ----------------------------------
>
> Key: METAMODEL-18
> URL: https://issues.apache.org/jira/browse/METAMODEL-18
> Project: Metamodel
> Issue Type: New Feature
> Reporter: Kasper Sørensen
> Priority: Critical
>
> A new module for MetaModel, providing support for Cassandra.
> Note that Cassandra in many respects is similar to HBase, and we might run
> into some of the same issues. Check METAMODEL-13 for our HBase module JIRA
> issue.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)