You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/03/03 22:00:45 UTC

[GitHub] [druid] JulianJaffePinterest opened a new pull request #9454: Add OnHeapMemorySegmentWriteOutMediumFactory

JulianJaffePinterest opened a new pull request #9454: Add OnHeapMemorySegmentWriteOutMediumFactory
URL: https://github.com/apache/druid/pull/9454
 
 
   Add a factory for OnHeapMemorySegmentWriteOutMedium to support direct writing via Spark.
   
   ### Description
   
   As part of the ongoing discussions on the Druid dev list, Slack channels, and other fora (including #9342), there appears to be significant community desire for writing directly from Spark to Druid. In order to support this, we should expose the ability to write segments using on-heap memory. While less efficient than using off-heap memory, on-heap memory is much easier to manage in Spark and common resource managers (e.g. YARN, Mesos, etc.). This factory is almost exactly the same as the existing OffHeapMemorySegmentWriteOutMediumFactory, with OnHeapMemorySegmentWriteOutMedium substituted for OffHeapMemorySegmentWriteOutMedium.
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/licenses.yaml)
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths.
   - [ ] added integration tests.
   - [x] been tested in a test Druid cluster.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * `OnHeapMemorySegmentWriteOutMediumFactory`
   

----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson commented on issue #9454: Add OnHeapMemorySegmentWriteOutMediumFactory

Posted by GitBox <gi...@apache.org>.
jihoonson commented on issue #9454: Add OnHeapMemorySegmentWriteOutMediumFactory
URL: https://github.com/apache/druid/pull/9454#issuecomment-595484957
 
 
   @JulianJaffePinterest I restarted the failed one. Would you please check [my comment above](https://github.com/apache/druid/pull/9454#pullrequestreview-368362199)? My question is basically what are the benefits of using the `OnHeapMemorySegmentWriteOutMediumFactory` instead of the temp file one. Is it for performance?

----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson commented on issue #9454: Add OnHeapMemorySegmentWriteOutMediumFactory

Posted by GitBox <gi...@apache.org>.
jihoonson commented on issue #9454: Add OnHeapMemorySegmentWriteOutMediumFactory
URL: https://github.com/apache/druid/pull/9454#issuecomment-595562798
 
 
   @JulianJaffePinterest thanks. The latest change looks good to me.

----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson commented on a change in pull request #9454: Add OnHeapMemorySegmentWriteOutMediumFactory

Posted by GitBox <gi...@apache.org>.
jihoonson commented on a change in pull request #9454: Add OnHeapMemorySegmentWriteOutMediumFactory
URL: https://github.com/apache/druid/pull/9454#discussion_r387324133
 
 

 ##########
 File path: processing/src/main/java/org/apache/druid/segment/writeout/OnHeapMemorySegmentWriteOutMediumFactory.java
 ##########
 @@ -0,0 +1,48 @@
+/*
+ * 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.druid.segment.writeout;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+import java.io.File;
+import java.io.IOException;
+
+public class OnHeapMemorySegmentWriteOutMediumFactory implements SegmentWriteOutMediumFactory
 
 Review comment:
   This class probably needs to be registered as a sub type of `SegmentWriteOutMediumFactory` [here](https://github.com/apache/druid/blob/master/processing/src/main/java/org/apache/druid/segment/writeout/SegmentWriteOutMediumFactory.java#L33).

----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] JulianJaffePinterest commented on issue #9454: Add OnHeapMemorySegmentWriteOutMediumFactory

Posted by GitBox <gi...@apache.org>.
JulianJaffePinterest commented on issue #9454: Add OnHeapMemorySegmentWriteOutMediumFactory
URL: https://github.com/apache/druid/pull/9454#issuecomment-595452089
 
 
   @jihoonson is there a way to rerun the Travis checks? The failure seems unrelated to my changes

----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] clintropolis merged pull request #9454: Add OnHeapMemorySegmentWriteOutMediumFactory

Posted by GitBox <gi...@apache.org>.
clintropolis merged pull request #9454: Add OnHeapMemorySegmentWriteOutMediumFactory
URL: https://github.com/apache/druid/pull/9454
 
 
   

----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson commented on issue #9454: Add OnHeapMemorySegmentWriteOutMediumFactory

Posted by GitBox <gi...@apache.org>.
jihoonson commented on issue #9454: Add OnHeapMemorySegmentWriteOutMediumFactory
URL: https://github.com/apache/druid/pull/9454#issuecomment-594705935
 
 
   The CI is failing because of the below error. Would you please check it?
   
   ```
   [ERROR] processing/src/main/java/org/apache/druid/segment/writeout/OnHeapMemorySegmentWriteOutMediumFactory.java:44 -- The declared exception <code>IOException</code> is never thrown
   ```
   
   Also, please update this [doc](https://github.com/apache/druid/blob/master/docs/configuration/index.md#segmentwriteoutmediumfactory) to properly explain the new configuration.

----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] JulianJaffePinterest commented on issue #9454: Add OnHeapMemorySegmentWriteOutMediumFactory

Posted by GitBox <gi...@apache.org>.
JulianJaffePinterest commented on issue #9454: Add OnHeapMemorySegmentWriteOutMediumFactory
URL: https://github.com/apache/druid/pull/9454#issuecomment-595549792
 
 
   Yes, this is primarily for performance. The main goal of adding this is to support direct writing from Spark, which can make working with off-heap memory difficult.

----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson commented on a change in pull request #9454: Add OnHeapMemorySegmentWriteOutMediumFactory

Posted by GitBox <gi...@apache.org>.
jihoonson commented on a change in pull request #9454: Add OnHeapMemorySegmentWriteOutMediumFactory
URL: https://github.com/apache/druid/pull/9454#discussion_r387833905
 
 

 ##########
 File path: processing/src/main/java/org/apache/druid/segment/writeout/OnHeapMemorySegmentWriteOutMediumFactory.java
 ##########
 @@ -0,0 +1,48 @@
+/*
+ * 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.druid.segment.writeout;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+import java.io.File;
+import java.io.IOException;
+
+public class OnHeapMemorySegmentWriteOutMediumFactory implements SegmentWriteOutMediumFactory
 
 Review comment:
   Thanks.

----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] JulianJaffePinterest commented on a change in pull request #9454: Add OnHeapMemorySegmentWriteOutMediumFactory

Posted by GitBox <gi...@apache.org>.
JulianJaffePinterest commented on a change in pull request #9454: Add OnHeapMemorySegmentWriteOutMediumFactory
URL: https://github.com/apache/druid/pull/9454#discussion_r387352260
 
 

 ##########
 File path: processing/src/main/java/org/apache/druid/segment/writeout/OnHeapMemorySegmentWriteOutMediumFactory.java
 ##########
 @@ -0,0 +1,48 @@
+/*
+ * 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.druid.segment.writeout;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+import java.io.File;
+import java.io.IOException;
+
+public class OnHeapMemorySegmentWriteOutMediumFactory implements SegmentWriteOutMediumFactory
 
 Review comment:
   Ah yeah I thought I was forgetting something. Added.

----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org