Skip to content

Commit 40fb721

Browse files
committed
Add licenses, fix features config
1 parent 0c2f6eb commit 40fb721

File tree

5 files changed

+35
-10
lines changed

5 files changed

+35
-10
lines changed

presto-main-base/src/main/java/com/facebook/presto/metadata/CodecDeserializer.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
114
package com.facebook.presto.metadata;
215

316
import com.facebook.presto.spi.ConnectorCodec;

presto-main-base/src/main/java/com/facebook/presto/metadata/CodecSerializer.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
114
package com.facebook.presto.metadata;
215

316
import com.facebook.presto.spi.ConnectorCodec;

presto-main-base/src/test/java/com/facebook/presto/catalogserver/TestCatalogServerResponse.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
*/
1414
package com.facebook.presto.catalogserver;
1515

16-
import com.facebook.airlift.configuration.ConfigurationFactory;
17-
import com.facebook.airlift.configuration.ConfigurationModule;
1816
import com.facebook.airlift.json.JsonModule;
1917
import com.facebook.presto.common.QualifiedObjectName;
2018
import com.facebook.presto.common.transaction.TransactionId;
@@ -30,7 +28,6 @@
3028
import com.facebook.presto.spi.connector.ConnectorTransactionHandle;
3129
import com.fasterxml.jackson.core.type.TypeReference;
3230
import com.fasterxml.jackson.databind.ObjectMapper;
33-
import com.google.common.collect.ImmutableMap;
3431
import com.google.inject.Guice;
3532
import com.google.inject.Injector;
3633
import org.testng.annotations.BeforeTest;
@@ -55,8 +52,7 @@ public class TestCatalogServerResponse
5552
public void setup()
5653
{
5754
this.testingCatalogServerClient = new TestingCatalogServerClient();
58-
ConfigurationFactory configurationFactory = new ConfigurationFactory(ImmutableMap.of());
59-
Injector injector = Guice.createInjector(new ConfigurationModule(configurationFactory), new JsonModule(), new TestingHandleJsonModule());
55+
Injector injector = Guice.createInjector(new JsonModule(), new TestingHandleJsonModule());
6056
this.objectMapper = injector.getInstance(ObjectMapper.class);
6157
}
6258

presto-main-base/src/test/java/com/facebook/presto/metadata/TestingHandleJsonModule.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@
1313
*/
1414
package com.facebook.presto.metadata;
1515

16+
import com.facebook.drift.codec.guice.ThriftCodecModule;
1617
import com.facebook.presto.connector.ConnectorManager;
1718
import com.facebook.presto.sql.analyzer.FeaturesConfig;
1819
import com.google.inject.Binder;
1920
import com.google.inject.Module;
2021
import com.google.inject.Scopes;
2122

22-
import static com.facebook.airlift.configuration.ConfigBinder.configBinder;
23-
2423
public class TestingHandleJsonModule
2524
implements Module
2625
{
2726
@Override
2827
public void configure(Binder binder)
2928
{
3029
binder.bind(ConnectorManager.class).toProvider(() -> null).in(Scopes.SINGLETON);
31-
configBinder(binder).bindConfig(FeaturesConfig.class);
30+
binder.bind(FeaturesConfig.class).toInstance(new FeaturesConfig());
3231

32+
binder.install(new ThriftCodecModule());
3333
binder.install(new HandleJsonModule());
3434
}
3535
}

presto-main-base/src/test/java/com/facebook/presto/sql/analyzer/TestFeaturesConfig.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ public void testDefaults()
269269
.setInEqualityJoinPushdownEnabled(false)
270270
.setRewriteMinMaxByToTopNEnabled(false)
271271
.setPrestoSparkExecutionEnvironment(false)
272-
.setMaxSerializableObjectSize(1000));
272+
.setMaxSerializableObjectSize(1000)
273+
.setUseConnectorProvidedSerializationCodecs(false));
273274
}
274275

275276
@Test
@@ -486,6 +487,7 @@ public void testExplicitPropertyMappings()
486487
.put("optimizer.utilize-unique-property-in-query-planning", "false")
487488
.put("optimizer.add-exchange-below-partial-aggregation-over-group-id", "true")
488489
.put("max_serializable_object_size", "50")
490+
.put("use-connector-provided-serialization-codecs", "true")
489491
.build();
490492

491493
FeaturesConfig expected = new FeaturesConfig()
@@ -700,7 +702,8 @@ public void testExplicitPropertyMappings()
700702
.setRewriteMinMaxByToTopNEnabled(true)
701703
.setInnerJoinPushdownEnabled(true)
702704
.setPrestoSparkExecutionEnvironment(true)
703-
.setMaxSerializableObjectSize(50);
705+
.setMaxSerializableObjectSize(50)
706+
.setUseConnectorProvidedSerializationCodecs(true);
704707
assertFullMapping(properties, expected);
705708
}
706709

0 commit comments

Comments
 (0)