-
Notifications
You must be signed in to change notification settings - Fork 6
Snap 2084 #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snap 2084 #86
Changes from all commits
a6c4083
78884fb
fb081c5
f7a49b1
9de66c9
b9e1247
eb7a6a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
| /* | ||
| * Copyright (c) 2017 SnappyData, Inc. All rights reserved. | ||
| * | ||
| * Licensed 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. See accompanying | ||
| * LICENSE file. | ||
| */ | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the previous copyright header of SnappyData as owner was correct (filehdr.txt). Since this file is created in our repo only, so original copyright cannot be Apache's.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is with scala-style. I could not find a way to allow either-or kind of setting in scala style checker. It fails if not Apache. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh. Perhaps add full SnappyData header below instead of modification header.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok |
||
| package org.apache.spark | ||
|
|
||
| import org.apache.spark.memory.MemoryManager | ||
| import org.apache.spark.util.Utils | ||
|
|
||
|
|
||
| object SparkSnappyUtils { | ||
|
|
||
| val SNAPPY_UNIFIED_MEMORY_MANAGER_CLASS = "org.apache.spark.memory.SnappyUnifiedMemoryManager" | ||
|
|
||
| def loadSnappyManager(conf: SparkConf, numUsableCores: Int): Option[MemoryManager] = { | ||
| try { | ||
| Some(Utils.classForName(SNAPPY_UNIFIED_MEMORY_MANAGER_CLASS) | ||
| .getConstructor(classOf[SparkConf], classOf[Int]) | ||
| .newInstance(conf, Int.box(numUsableCores)) | ||
| .asInstanceOf[MemoryManager]) | ||
| } catch { | ||
| case ex: ClassNotFoundException => None | ||
| } | ||
| } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An explicit setting of "spark.memory.manager" should override SnappyUMM. So this should be changed in the getOrElse block of previous code: