-
Notifications
You must be signed in to change notification settings - Fork 216
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 #16 from Netflix/feature/producer-api
High Level Producer API
- Loading branch information
Showing
13 changed files
with
1,592 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
hollow/src/main/java/com/netflix/hollow/api/consumer/HollowConsumer.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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* | ||
* Copyright 2017 Netflix, Inc. | ||
* | ||
* 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 com.netflix.hollow.api.consumer; | ||
|
||
import com.netflix.hollow.core.read.engine.HollowReadStateEngine; | ||
|
||
/** | ||
* Alpha API subject to change. | ||
* | ||
* @author Tim Taylor {@literal<[email protected]>} | ||
*/ | ||
public class HollowConsumer { | ||
public static ReadState newReadState(long version, HollowReadStateEngine stateEngine) { | ||
return new ReadStateImpl(version, stateEngine); | ||
} | ||
|
||
public static interface ReadState { | ||
long getVersion(); | ||
HollowReadStateEngine getStateEngine(); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
hollow/src/main/java/com/netflix/hollow/api/consumer/ReadStateImpl.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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* | ||
* Copyright 2017 Netflix, Inc. | ||
* | ||
* 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 com.netflix.hollow.api.consumer; | ||
|
||
import com.netflix.hollow.core.read.engine.HollowReadStateEngine; | ||
|
||
/** | ||
* Alpha API subject to change. | ||
* | ||
* @author Tim Taylor {@literal<[email protected]>} | ||
*/ | ||
class ReadStateImpl implements HollowConsumer.ReadState { | ||
private final long version; | ||
private final HollowReadStateEngine stateEngine; | ||
|
||
|
||
|
||
// TODO: timt: should be package protected | ||
public ReadStateImpl(long version, HollowReadStateEngine stateEngine) { | ||
this.version = version; | ||
this.stateEngine = stateEngine; | ||
} | ||
|
||
|
||
@Override | ||
public long getVersion() { | ||
return version; | ||
} | ||
|
||
@Override | ||
public HollowReadStateEngine getStateEngine() { | ||
return stateEngine; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
hollow/src/main/java/com/netflix/hollow/api/producer/AbstractHollowProducerListener.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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* | ||
* Copyright 2017 Netflix, Inc. | ||
* | ||
* 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 com.netflix.hollow.api.producer; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
/** | ||
* Beta API subject to change. | ||
* | ||
* @author Tim Taylor {@literal<[email protected]>} | ||
*/ | ||
public class AbstractHollowProducerListener implements HollowProducerListener { | ||
@Override public void onProducerInit(long elapsed, TimeUnit unit) {} | ||
|
||
@Override public void onProducerRestoreStart(long restoreVersion) {} | ||
@Override public void onProducerRestoreComplete(RestoreStatus status, long elapsed, TimeUnit unit) {} | ||
@Override public void onNewDeltaChain(long version) {} | ||
|
||
@Override public void onCycleStart(long version) {} | ||
@Override public void onCycleComplete(ProducerStatus status, long elapsed, TimeUnit unit) {} | ||
|
||
@Override public void onNoDeltaAvailable(long version) {} | ||
|
||
@Override public void onPublishStart(long version) {} | ||
@Override public void onPublishComplete(ProducerStatus status, long elapsed, TimeUnit unit) {} | ||
|
||
@Override public void onIntegrityCheckStart(long version) {} | ||
@Override public void onIntegrityCheckComplete(ProducerStatus status, long elapsed, TimeUnit unit) {} | ||
|
||
@Override public void onValidationStart(long version) {} | ||
@Override public void onValidationComplete(ProducerStatus status, long elapsed, TimeUnit unit) {} | ||
|
||
@Override public void onAnnouncementStart(long version) {} | ||
@Override public void onAnnouncementComplete(ProducerStatus status, long elapsed, TimeUnit unit) {} | ||
} |
Oops, something went wrong.