2016년 4월 3일 일요일

Github openSource 의 코드 살펴보기

Github에서 핫한 java project  를 다운받아서 코드를 살펴보았다.

정말 캐고수들의 향연이라는 기대감을 품고.

이들의 코드를 보면 내 위치를 조금은 알 수 있겠지.

내가 선택한 프로젝트는 apache/spark이다.

흠...굉장히 방대해서 뭐 부터 봐야 할지 모르겠다. ㅠ.ㅠ

폴더가 24개.

core폴더부터 봐본다.

특이한 annotation 발견


@Retention
@Target
@interface

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER,
        ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.PACKAGE})
public @interface AlphaComponent {}

public interface JavaFutureAction<T> extends Future<T> {

template도 좀 알아야 될 거 같고...

abstract class JavaSparkContextVarargsWorkaround
abstract class도 썼군. 

.apply 라는 함수는 뭐지. 

private static final Optional<?> EMPTY = new Optional<>();

<?> 는 뭐예용?


 public static <T> Optional<T> ofNullable(T value) {
    if (value == null) {
      return empty();
    } else {
      return of(value);
    }
  }

ofNullable ... 

public interface SparkJobInfo extends Serializable

인터페이스도 상속이 되는군...

@Private 이라는 어노테이션..

낯선 어노테이션, 템플릿, 문법....

자바를 오래 해왔는데, 이쪽 세계는 또 낯선 세계다 ㅠㅠ




댓글 없음:

댓글 쓰기