forked from apache/drill
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DRILL-3742: Classpath scanning and build improvement
Makes the classpath scanning a build time class discovery Makes the fmpp generation incremental Removes some slowness in DrillBit closing Reduces the build time by 30% This closes apache#148
- Loading branch information
1 parent
6576123
commit dbcab0f
Showing
142 changed files
with
3,608 additions
and
1,318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
common/src/main/java/org/apache/drill/common/config/LogicalPlanPersistence.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* 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.drill.common.config; | ||
|
||
import java.util.Set; | ||
|
||
import org.apache.drill.common.expression.LogicalExpression; | ||
import org.apache.drill.common.expression.SchemaPath; | ||
import org.apache.drill.common.logical.FormatPluginConfigBase; | ||
import org.apache.drill.common.logical.StoragePluginConfigBase; | ||
import org.apache.drill.common.logical.data.LogicalOperatorBase; | ||
import org.apache.drill.common.scanner.persistence.ScanResult; | ||
|
||
import com.fasterxml.jackson.core.JsonGenerator; | ||
import com.fasterxml.jackson.core.JsonParser.Feature; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.SerializationFeature; | ||
import com.fasterxml.jackson.databind.module.SimpleModule; | ||
|
||
|
||
public class LogicalPlanPersistence { | ||
private ObjectMapper mapper; | ||
|
||
public ObjectMapper getMapper() { | ||
return mapper; | ||
} | ||
|
||
public LogicalPlanPersistence(DrillConfig conf, ScanResult scanResult) { | ||
mapper = new ObjectMapper(); | ||
|
||
SimpleModule deserModule = new SimpleModule("LogicalExpressionDeserializationModule") | ||
.addDeserializer(LogicalExpression.class, new LogicalExpression.De(conf)) | ||
.addDeserializer(SchemaPath.class, new SchemaPath.De()); | ||
|
||
mapper.registerModule(deserModule); | ||
mapper.enable(SerializationFeature.INDENT_OUTPUT); | ||
mapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); | ||
mapper.configure(JsonGenerator.Feature.QUOTE_FIELD_NAMES, true); | ||
mapper.configure(Feature.ALLOW_COMMENTS, true); | ||
registerSubtypes(LogicalOperatorBase.getSubTypes(scanResult)); | ||
registerSubtypes(StoragePluginConfigBase.getSubTypes(scanResult)); | ||
registerSubtypes(FormatPluginConfigBase.getSubTypes(scanResult)); | ||
} | ||
|
||
private <T> void registerSubtypes(Set<Class<? extends T>> types) { | ||
for (Class<? extends T> type : types) { | ||
mapper.registerSubtypes(type); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.