[ 
https://issues.apache.org/jira/browse/BEAM-6820?focusedWorklogId=218542&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-218542
 ]

ASF GitHub Bot logged work on BEAM-6820:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Mar/19 09:02
            Start Date: 26/Mar/19 09:02
    Worklog Time Spent: 10m 
      Work Description: iemejia commented on pull request #8069: [BEAM-6820] 
Cassandra object mapper abstraction
URL: https://github.com/apache/beam/pull/8069#discussion_r268994664
 
 

 ##########
 File path: 
sdks/java/io/cassandra/src/main/java/org/apache/beam/sdk/io/cassandra/DefaultObjectMapperFactory.java
 ##########
 @@ -0,0 +1,42 @@
+/*
+ * 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.beam.sdk.io.cassandra;
+
+import com.datastax.driver.core.Session;
+import com.datastax.driver.mapping.MappingManager;
+import java.io.Serializable;
+
+/**
+ * Factory implementation that CassandraIO uses to initialize the Default 
Object Mapper for mapping
+ * POJOs to CRUD events in Cassandra.
+ *
+ * @see org.apache.beam.sdk.io.cassandra.DefaultObjectMapper
+ */
+public class DefaultObjectMapperFactory<T> implements MapperFactory<T>, 
Serializable {
 
 Review comment:
   Make package private remove the implements and implement 
`SerializableFunction<Session, Mapper>`.pass the entity in the constructor of 
this class.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 218542)
    Time Spent: 5.5h  (was: 5h 20m)

> Custom Row-Object mapper implementation for CassandraIO
> -------------------------------------------------------
>
>                 Key: BEAM-6820
>                 URL: https://issues.apache.org/jira/browse/BEAM-6820
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-cassandra
>            Reporter: Max Charas
>            Assignee: Max Charas
>            Priority: Minor
>          Time Spent: 5.5h
>  Remaining Estimate: 0h
>
> The current Cassandra source sink is tightly coupled to the Datastax Object 
> Mapper. [This requires 
> users|https://docs.datastax.com/en/developer/java-driver/3.1/manual/object_mapper/]
>  of the sink to provide a POJO describing  the table in Cassandra. Although 
> the POJO is a easy and powerful way to describe the table it does requires 
> users to always recompile the pipeline for each change in the table 
> definition. 
> I suggest adding a abstraction layer that allows users to inject their own 
> mapper implementation. One example use would be a mapper that works with a 
> generic 
> [Row|https://beam.apache.org/releases/javadoc/2.4.0/org/apache/beam/sdk/values/Row.html]
>  implementation rather than a compile-time POJO. 
> This abstraction layer could be implemented by simply supplying a 
> MapperFactory through the Sink/Source builder. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to