drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julienledem <...@git.apache.org>
Subject [GitHub] drill pull request: DRILL-3742: Classpath scanning
Date Tue, 13 Oct 2015 23:23:47 GMT
Github user julienledem commented on a diff in the pull request:

    https://github.com/apache/drill/pull/148#discussion_r41939482
  
    --- Diff: common/src/main/java/org/apache/drill/common/scanner/ClassPathScanner.java ---
    @@ -0,0 +1,458 @@
    +/**
    + * 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.scanner;
    +
    +import static java.lang.String.format;
    +import static java.util.Arrays.asList;
    +import static java.util.Collections.unmodifiableList;
    +import static java.util.Collections.unmodifiableSet;
    +import static java.util.concurrent.TimeUnit.MILLISECONDS;
    +
    +import java.io.IOException;
    +import java.net.URL;
    +import java.util.ArrayList;
    +import java.util.Arrays;
    +import java.util.Collection;
    +import java.util.Collections;
    +import java.util.Enumeration;
    +import java.util.HashSet;
    +import java.util.List;
    +import java.util.Set;
    +
    +import org.apache.drill.common.config.CommonConstants;
    +import org.apache.drill.common.config.DrillConfig;
    +import org.apache.drill.common.scanner.persistence.AnnotationDescriptor;
    +import org.apache.drill.common.scanner.persistence.AttributeDescriptor;
    +import org.apache.drill.common.scanner.persistence.ChildClassDescriptor;
    +import org.apache.drill.common.scanner.persistence.FieldDescriptor;
    +import org.apache.drill.common.scanner.persistence.FunctionDescriptor;
    +import org.apache.drill.common.scanner.persistence.ParentClassDescriptor;
    +import org.apache.drill.common.scanner.persistence.ScanResult;
    +import org.reflections.Reflections;
    +import org.reflections.adapters.JavassistAdapter;
    +import org.reflections.scanners.AbstractScanner;
    +import org.reflections.util.ConfigurationBuilder;
    +import org.reflections.util.FilterBuilder;
    +
    +import com.google.common.base.Stopwatch;
    +import com.google.common.collect.HashMultimap;
    +import com.google.common.collect.Multimap;
    +import com.google.common.collect.Sets;
    +
    +import javassist.bytecode.AccessFlag;
    +import javassist.bytecode.AnnotationsAttribute;
    +import javassist.bytecode.ClassFile;
    +import javassist.bytecode.FieldInfo;
    +import javassist.bytecode.annotation.AnnotationMemberValue;
    +import javassist.bytecode.annotation.ArrayMemberValue;
    +import javassist.bytecode.annotation.BooleanMemberValue;
    +import javassist.bytecode.annotation.ByteMemberValue;
    +import javassist.bytecode.annotation.CharMemberValue;
    +import javassist.bytecode.annotation.ClassMemberValue;
    +import javassist.bytecode.annotation.DoubleMemberValue;
    +import javassist.bytecode.annotation.EnumMemberValue;
    +import javassist.bytecode.annotation.FloatMemberValue;
    +import javassist.bytecode.annotation.IntegerMemberValue;
    +import javassist.bytecode.annotation.LongMemberValue;
    +import javassist.bytecode.annotation.MemberValue;
    +import javassist.bytecode.annotation.MemberValueVisitor;
    +import javassist.bytecode.annotation.ShortMemberValue;
    +import javassist.bytecode.annotation.StringMemberValue;
    +
    +/**
    + * Classpath scanning utility.
    + * The classpath should be scanned once at startup from a DrillConfig instance. {@see
ClassPathScanner#fromPrescan(DrillConfig)}
    + * The DrillConfig provides the list of packages to scan. (drill.classpath.scanning.packages)
{@see CommonConstants#IMPLEMENTATIONS_SCAN_PACKAGES}
    + * Only the class directories and jars containing a drill-module.conf will be scanned.
    + * Drill core packages are scanned at build time and the result is saved in a JSON file.
{@see ClassPathScanner#FUNCTION_REGISTRY_FILE}
    + * At runtime only the packages that have not be scanned yet will be scanned.
    + */
    +public final class ClassPathScanner {
    +  private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ClassPathScanner.class);
    +  private static final JavassistAdapter METADATA_ADAPTER = new JavassistAdapter();
    +
    +  /**
    +   * defines all the things to scan for
    +   */
    +  private static final Set<String> SCANNED_CLASSES = unmodifiableSet(
    +      new HashSet<>(asList(
    +          "org.apache.drill.common.logical.data.LogicalOperator",
    --- End diff --
    
    yes this has changed already, will push


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message