This file contains hidden or 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
| syntax = "proto3"; | |
| package contract; | |
| service Connect { | |
| rpc InitMoneyTransfer (InitMoneyTransferRequest) returns (Transfer) {} | |
| rpc ApproveTransfer (ApproveRequest) returns (Transfer) {} | |
| rpc RejectTransfer (RejectRequest) returns (Transfer) {} | |
| } |
This file contains hidden or 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
| SET track_io_timing = ON; | |
| EXPLAIN(ANALYZE, buffers ) select * from domain_event_entry where global_index > 10109734 order by global_index limit 100; | |
| Limit (cost=0.43..34.95 rows=100 width=334) (actual time=0.047..0.128 rows=100 loops=1) | |
| Buffers: shared hit=102 read=1 | |
| I/O Timings: read=0.013 | |
| -> Index Scan using domain_event_entry_pkey on domain_event_entry | |
| (cost=0.43..10712.22 rows=31039 width=334) (actual time=0.044..0.114 rows=100 loops=1) | |
| Index Cond: (global_index > 10101235) | |
| Buffers: shared hit=102 read=1 |
This file contains hidden or 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
| @Bean | |
| public EventStorageEngine eventStorageEngine(Serializer defaultSerializer, | |
| PersistenceExceptionResolver persistenceExceptionResolver, | |
| @Qualifier("eventSerializer") Serializer eventSerializer, | |
| AxonConfiguration configuration, | |
| EntityManagerProvider entityManagerProvider, | |
| TransactionManager transactionManager) { | |
| final JpaEventStorageEngine.Builder builder = JpaEventStorageEngine.builder() |
This file contains hidden or 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
| private List<Object[]> getEvents(GapAwareTrackingToken previousToken, int batchSize) { | |
| List<Object[]> events = new ArrayList<>(); | |
| if (!Objects.isNull(previousToken) && !previousToken.getGaps().isEmpty()) { | |
| List<Object[]> gapResult = entityManager() | |
| .createQuery("SELECT e.globalIndex, e.type, e.aggregateIdentifier, e.sequenceNumber, e.eventIdentifier, " + "e.timeStamp, e.payloadType, e.payloadRevision, e.payload, e.metaData " + "FROM " + domainEventEntryEntityName() + " e " + "WHERE e.globalIndex IN :gaps ORDER BY e.globalIndex ASC", Object[].class) | |
| .setParameter("gaps", previousToken.getGaps()) | |
| .setMaxResults(batchSize) | |
| .getResultList(); | |
| events.addAll(gapResult); |
This file contains hidden or 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
| #part one | |
| select * from domain_event_entry where global_index > :index order by global_index limit 100; | |
| #part two | |
| select * from domain_event_entry where global_index in (:gaps) order by global_index ASC limit 100; |
This file contains hidden or 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
| #first | |
| select * from domain_event_entry where global_index > 10109735 order by global_index limit 100; | |
| #second | |
| select * from domain_event_entry where global_index > 10109735 or global_index in (10101734,10102734,10103734,10104734,10105734) order by global_index ASC limit 100; |
This file contains hidden or 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
| @Override | |
| protected List<? extends TrackedEventData<?>> fetchTrackedEvents(TrackingToken lastToken, int batchSize) { | |
| Assert.isTrue( | |
| lastToken == null || lastToken instanceof GapAwareTrackingToken, | |
| () -> String.format("Token [%s] is of the wrong type. Expected [%s]", | |
| lastToken, GapAwareTrackingToken.class.getSimpleName()) | |
| ); | |
| GapAwareTrackingToken previousToken = cleanedToken((GapAwareTrackingToken) lastToken); |
This file contains hidden or 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
| pragma solidity ^0.4.0; | |
| contract Blackjack { | |
| event test_value(string name); | |
| event joinedPlayer( | |
| address playerAdd, | |
| uint bet, | |
| address ownAdd |
This file contains hidden or 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
| pragma solidity ^0.4.0; | |
| contract EtherTransferTo { | |
| function () public payable { | |
| } | |
| function getBalance() public returns (uint) { | |
| return address(this).balance; | |
| } | |
| } |