-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
475de5b
commit 8bcabb7
Showing
161 changed files
with
1,015 additions
and
458 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,94 @@ | ||
/* | ||
* Copyright (C) 2018 The Sylph Authors | ||
* | ||
* 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. | ||
*/ | ||
package ideal.sylph.etl; | ||
|
||
import java.util.Arrays; | ||
|
||
public interface Record | ||
{ | ||
String mkString(String seq); | ||
|
||
default String mkString() | ||
{ | ||
return this.mkString(","); | ||
} | ||
|
||
<T> T getAs(String key); | ||
|
||
<T> T getAs(int i); | ||
|
||
default <T> T getField(int i) | ||
{ | ||
return getAs(i); | ||
} | ||
|
||
int size(); | ||
|
||
public static Record of(Object[] values) | ||
{ | ||
return new DefaultRecord(values); | ||
} | ||
|
||
static class DefaultRecord | ||
implements Record | ||
{ | ||
Object[] values; | ||
|
||
private DefaultRecord(Object[] values) | ||
{ | ||
this.values = values; | ||
} | ||
|
||
public Object[] getValues() | ||
{ | ||
return Arrays.copyOf(values, values.length); | ||
} | ||
|
||
@Override | ||
public String mkString(String seq) | ||
{ | ||
StringBuilder stringBuilder = new StringBuilder(); | ||
for (int i = 0; i < values.length; i++) { | ||
stringBuilder.append(seq).append(values[i]); | ||
} | ||
return stringBuilder.substring(1); | ||
} | ||
|
||
@Override | ||
public String mkString() | ||
{ | ||
return this.mkString(","); | ||
} | ||
|
||
@Override | ||
public <T> T getAs(String key) | ||
{ | ||
throw new UnsupportedOperationException("this " + this.getClass().getName() + " method have't T getAs(String)!"); | ||
} | ||
|
||
@Override | ||
public <T> T getAs(int key) | ||
{ | ||
throw new UnsupportedOperationException("this " + this.getClass().getName() + " method have't T getAs(int)!"); | ||
} | ||
|
||
@Override | ||
public int size() | ||
{ | ||
return values.length; | ||
} | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
dependencies { | ||
compile group: 'org.apache.flink', name: 'flink-shaded-guava', version: '18.0-5.0' | ||
compileOnly project(":sylph-etl-api") | ||
compileOnly project(":sylph-api") | ||
compileOnly group: 'org.slf4j', name: 'slf4j-api', version: deps.slf4j | ||
} |
Oops, something went wrong.