Skip to content

Instantly share code, notes, and snippets.

View fpj's full-sized avatar
🎯
Pravega

Flavio Junqueira fpj

🎯
Pravega
View GitHub Profile
@fpj
fpj / governance.md
Last active April 23, 2021 14:48
Project governance (draft)

Pravega Project Governance

Pravega is an code repository organization hosted by CNCF comprising repositories supporting and forming an ecosystem for streaming data. All repositories under the Pravega organization are driven by the bylaws described in this document. This document covers the structure of the various groups that form Pravega and the processes used to govern the organization.

Mission

Pravega targets the development of software for streaming data, with a focus on storage. It is core to our mission to develop and grow a thriving community of software developers. The community drives the technical direction of Pravega via open discussions and votings. By design, very few actions are private. It accepts contributions from any interested party as long as such a contribution is performed according to the project Code of Conduct. The Pravega community praises diversity and inclusion.

Structure

The project comprises two main groups of contributors:

1- Steering Committee. The Steering Commi

@fpj
fpj / BatchReadFromSegment.java
Created November 23, 2020 17:38
Batch reads - Read from segment
SegmentIterator<T> events =
client.readSegment(segmentInfo.getSegment(),
deserializer);
while (events.hasNext()) {
processEvent(events.next());
}
@fpj
fpj / SegmentIterator.java
Created November 23, 2020 17:36
Batch reads - List segments
Iterator<SegmentInfo> segments = client.listSegments(stream);
SegmentInfo segmentInfo = segments.next();
@fpj
fpj / SimpleEventReads.java
Last active November 23, 2020 17:33
Simple Event Reads
// Set up a new scope and stream with a single segment
// (no scaling)
StreamManager streamManager =
StreamManager.create(controllerURI);
StreamConfiguration streamConfig = StreamConfiguration.builder()
.scope(scope)
.streamName(streamName)
.scalingPolicy(ScalingPolicy.fixed(1))
.build();
streamManager.createScope(scope);
@fpj
fpj / SimpleTxnWrites.java
Last active November 23, 2020 17:26
Simple Transaction Writes
Transaction<String> txn = writer.beginTxn();
txn.writeEvent("Key 1", "Hola");
txn.writeEvent("Key 2", "Mundo!");
txn.commit();
@fpj
fpj / SimpleEventWrite.java
Last active November 23, 2020 17:24
Simple event writes
// Set up a new scope and stream with a single segment
// (no scaling)
StreamManager streamManager =
StreamManager.create(controllerURI);
StreamConfiguration streamConfig = StreamConfiguration.builder()
.scope(scope)
.streamName(streamName)
.scalingPolicy(ScalingPolicy.fixed(1))
.build();
streamManager.createScope(scope);
@fpj
fpj / sample-policies.java
Last active September 14, 2018 16:16
Scaling and Retention policies - Sample
// Set up scaling and retention policies.
//
// In this example, the scaling policy sets the target rate to be
// of 10 events/second, with a scaling factor of 2, and a minimum
// of 2 segments.
//
// http://pravega.io/docs/latest/javadoc/javadoc/clients/io/pravega/client/stream/ScalingPolicy.html
//
// The retention policy sets it to an hour. With this policy, Pravega
// retains stream data for at least an hour and truncates eventually
@fpj
fpj / build-#779-testMultiStreams.log
Created March 23, 2018 11:07
testMultiStreams logs in build #779
2018-03-22 16:22:13,729 INFO [Thread-66] quorum.QuorumPeerConfig (QuorumPeerConfig.java:parseProperties(327)) - clientPortAddress is 0.0.0.0/0.0.0.0:35551
2018-03-22 16:22:13,729 INFO [Thread-66] quorum.QuorumPeerConfig (QuorumPeerConfig.java:parseProperties(331)) - secureClientPort is not set
2018-03-22 16:22:13,731 INFO [Thread-66] test.TestingZooKeeperMain (TestingZooKeeperMain.java:internalRunFromConfig(218)) - Starting server
2018-03-22 16:22:13,731 INFO [Thread-66] server.ZooKeeperServer (ZooKeeperServer.java:setMinSessionTimeout(907)) - minSessionTimeout set to 6000
2018-03-22 16:22:13,731 INFO [Thread-66] server.ZooKeeperServer (ZooKeeperServer.java:setMaxSessionTimeout(916)) - maxSessionTimeout set to 60000
2018-03-22 16:22:13,731 INFO [Thread-66] server.ZooKeeperServer (ZooKeeperServer.java:<init>(159)) - Created server with tickTime 3000 minSessionTimeout 6000 maxSessionTimeout 60000 datadir /tmp/1521750133729-0/version-2 snapdir /tmp/1521750133729-0/version-2
2018-03-22 16:22:13,731 INFO [T
@fpj
fpj / test.md
Created February 6, 2018 14:38
         try {
             segmentRead = outstandingRequest.join();
         } catch (Exception e) {
             if (Exceptions.unwrap(e) instanceof SegmentTruncatedException) {
                 receivedTruncated = true;
             }
             throw e;
          }
@fpj
fpj / my list.java
Last active February 5, 2018 18:00
List serialization with #1956
@Data
@Builder
private static class MyList<Serializer> {
private final List<Serializer> list;
static class MyListBuilder implements ClassBuilder<MyList> {
}
}
private static class MyListSerializer extends Serializer<MyList<Serializer>> {