cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cassandra-sidecar] dineshjoshi commented on a change in pull request #4: Virtual tables API endpoints for sidecar for CASSANDRA-15124
Date Thu, 22 Aug 2019 18:29:42 GMT
dineshjoshi commented on a change in pull request #4: Virtual tables API endpoints for sidecar
for CASSANDRA-15124
URL: https://github.com/apache/cassandra-sidecar/pull/4#discussion_r316816812
 
 

 ##########
 File path: src/main/java/org/apache/cassandra/sidecar/VirtualTables.java
 ##########
 @@ -0,0 +1,342 @@
+/*
+ * 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.cassandra.sidecar;
+
+import java.net.InetAddress;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.UUID;
+import javax.annotation.Nullable;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import org.apache.commons.lang3.NotImplementedException;
+
+import com.datastax.driver.core.Host;
+import com.datastax.driver.core.ResultSetFuture;
+import com.datastax.driver.core.Session;
+import com.datastax.driver.core.exceptions.NoHostAvailableException;
+import com.datastax.driver.mapping.DefaultNamingStrategy;
+import com.datastax.driver.mapping.DefaultPropertyMapper;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.MappingConfiguration;
+import com.datastax.driver.mapping.MappingManager;
+import com.datastax.driver.mapping.NamingConventions;
+import com.datastax.driver.mapping.PropertyAccessStrategy;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.annotations.Table;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import io.vertx.core.json.JsonObject;
+
+/**
+ * Exposee virtual tables contents as pojos
+ */
+@Singleton
+public class VirtualTables
+{
+    private final CQLSession session;
+    private MappingConfiguration conf;
+
+    private MappingManager mappingManager;
+
+    @Inject
+    public VirtualTables(CQLSession session)
+    {
+        this.session = session;
+        conf = MappingConfiguration.builder()
+                            .withPropertyMapper(
+                                new DefaultPropertyMapper()
+                                    .setNamingStrategy(
+                                        new DefaultNamingStrategy(
+                                            NamingConventions.LOWER_CAMEL_CASE, NamingConventions.LOWER_SNAKE_CASE))
+                                    .setPropertyAccessStrategy(PropertyAccessStrategy.FIELDS))
+                            .build();
+    }
+
+    @Nullable
+    MappingManager manger()
 
 Review comment:
   Typo? Did you mean `manager()`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message