This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
-
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.
Merge pull request #56 from FCG-LLC/streaming
Streaming
- Loading branch information
Showing
8 changed files
with
398 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
connector.name=hyena | ||
hyena.url=ipc:///tmp/hyena/hyena.ipc | ||
|
||
hyena.streaming_enabled=true | ||
hyena.streaming_records_limit=2000000 | ||
hyena.streaming_records_threshold=2000000 |
Submodule hyena-java
updated
from 9b7d72 to 4dd3b0
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
42 changes: 41 additions & 1 deletion
42
presto-hyena/src/main/java/co/llective/presto/hyena/HyenaConnectorSessionProperties.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 |
---|---|---|
@@ -1,24 +1,64 @@ | ||
package co.llective.presto.hyena; | ||
|
||
import com.facebook.presto.spi.ConnectorSession; | ||
import com.facebook.presto.spi.session.PropertyMetadata; | ||
import com.google.common.collect.ImmutableList; | ||
|
||
import javax.inject.Inject; | ||
|
||
import java.util.List; | ||
|
||
import static co.llective.presto.hyena.HyenaConfig.STREAMING_ENABLED; | ||
import static co.llective.presto.hyena.HyenaConfig.STREAMING_ENABLED_DESC; | ||
import static co.llective.presto.hyena.HyenaConfig.STREAMING_RECORDS_LIMIT; | ||
import static co.llective.presto.hyena.HyenaConfig.STREAMING_RECORDS_LIMIT_DESC; | ||
import static co.llective.presto.hyena.HyenaConfig.STREAMING_RECORDS_THRESHOLD; | ||
import static co.llective.presto.hyena.HyenaConfig.STREAMING_RECORDS_THRESHOLD_DESC; | ||
import static com.facebook.presto.spi.session.PropertyMetadata.booleanSessionProperty; | ||
import static com.facebook.presto.spi.session.PropertyMetadata.longSessionProperty; | ||
|
||
public class HyenaConnectorSessionProperties | ||
{ | ||
private final List<PropertyMetadata<?>> sessionProperties; | ||
|
||
@Inject | ||
public HyenaConnectorSessionProperties(HyenaConfig hyenaConfig) | ||
{ | ||
sessionProperties = ImmutableList.of(); | ||
sessionProperties = ImmutableList.of( | ||
booleanSessionProperty( | ||
STREAMING_ENABLED, | ||
STREAMING_ENABLED_DESC, | ||
hyenaConfig.getStreamingEnabled(), | ||
false), | ||
longSessionProperty( | ||
STREAMING_RECORDS_LIMIT, | ||
STREAMING_RECORDS_LIMIT_DESC, | ||
hyenaConfig.getStreamingRecordsLimit(), | ||
false), | ||
longSessionProperty( | ||
STREAMING_RECORDS_THRESHOLD, | ||
STREAMING_RECORDS_THRESHOLD_DESC, | ||
hyenaConfig.getStreamingRecordsThreshold(), | ||
false)); | ||
} | ||
|
||
public List<PropertyMetadata<?>> getSessionProperties() | ||
{ | ||
return sessionProperties; | ||
} | ||
|
||
public static boolean getStreamingEnabled(ConnectorSession session) | ||
{ | ||
return session.getProperty(STREAMING_ENABLED, Boolean.class); | ||
} | ||
|
||
public static long getStreamingRecordsLimit(ConnectorSession session) | ||
{ | ||
return session.getProperty(STREAMING_RECORDS_LIMIT, Long.class); | ||
} | ||
|
||
public static long getStreamingRecordsThreshold(ConnectorSession session) | ||
{ | ||
return session.getProperty(STREAMING_RECORDS_THRESHOLD, Long.class); | ||
} | ||
} |
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.