@Test @Ignore public void readPerformanceTest() throws Exception { short[] partitions = new short[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; Short [] p = new Short[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; store.rePartition(p); writePerformanceTest(5L * 1024 * 1024 * 1024, 1024, 10, false, QosLevel.REPLICATION, partitions); destroyStore(); recoverStore(); readPerformanceTest(10, partitions); }
synchronized void rePartition(Short[] partitions) throws IOException { for (short partition : partitions) { if (!partitionMap.containsKey(partition)) { addPartition(partition); } } List<Short> partitionList = Arrays.asList(partitions); List<Short> toBeRemoved = new ArrayList<>(); for (Map.Entry<Short, Partition> entry : partitionMap.entrySet()) { if (!partitionList.contains(entry.getKey())) { toBeRemoved.add(entry.getKey()); } } for (Short partition : toBeRemoved) { removePartition(partition); } }
PartitionGroupStoreManager extends Service implements ReplicableStore, Closeable { synchronized void rePartition(Short[] partitions) throws IOException { for (short partition : partitions) { if (!partitionMap.containsKey(partition)) { addPartition(partition); } } List<Short> partitionList = Arrays.asList(partitions); List<Short> toBeRemoved = new ArrayList<>(); for (Map.Entry<Short, Partition> entry : partitionMap.entrySet()) { if (!partitionList.contains(entry.getKey())) { toBeRemoved.add(entry.getKey()); } } for (Short partition : toBeRemoved) { removePartition(partition); } } }
PartitionGroupStoreManager extends Service implements ReplicableStore, Closeable { synchronized void rePartition(Short[] partitions) throws IOException { for (short partition : partitions) { if (!partitionMap.containsKey(partition)) { addPartition(partition); } } List<Short> partitionList = Arrays.asList(partitions); List<Short> toBeRemoved = new ArrayList<>(); for (Map.Entry<Short, Partition> entry : partitionMap.entrySet()) { if (!partitionList.contains(entry.getKey())) { toBeRemoved.add(entry.getKey()); } } for (Short partition : toBeRemoved) { removePartition(partition); } } PartitionGroupStoreManager(String topic, int partitionGroup, File base, Config config,
                                      PreloadBufferPool bufferPool); }
PartitionGroupStoreManager extends Service implements ReplicableStore, Closeable { synchronized void rePartition(Short[] partitions) throws IOException { for (short partition : partitions) { if (!partitionMap.containsKey(partition)) { addPartition(partition); } } List<Short> partitionList = Arrays.asList(partitions); List<Short> toBeRemoved = new ArrayList<>(); for (Map.Entry<Short, Partition> entry : partitionMap.entrySet()) { if (!partitionList.contains(entry.getKey())) { toBeRemoved.add(entry.getKey()); } } for (Short partition : toBeRemoved) { removePartition(partition); } } PartitionGroupStoreManager(String topic, int partitionGroup, File base, Config config,
                                      PreloadBufferPool bufferPool); void recover(); String getTopic(); int getPartitionGroup(); ReadResult read(short partition, long index, int count, long maxSize); long getLeftIndex(short partition); long getLeftIndexAndCheck(short partition); long getRightIndex(short partition); long getRightIndexAndCheck(short partition); @Override boolean serviceStatus(); @Override void enable(); @Override void disable(); @Override void setRightPosition(long position); @Override void clear(long position); @Override long commitPosition(); @Override int term(); @Override void term(int term); @Override ByteBuffer readEntryBuffer(long position, int length); @Override long appendEntryBuffer(ByteBuffer byteBuffer); @Override long position(long position, int offsetCount); @Override int lastEntryTerm(); @Override void commit(long position); @Override int getEntryTerm(long position); @Override long leftPosition(); long rightPosition(); @Override void close(); long getIndex(short partition, long timestamp); }
PartitionGroupStoreManager extends Service implements ReplicableStore, Closeable { synchronized void rePartition(Short[] partitions) throws IOException { for (short partition : partitions) { if (!partitionMap.containsKey(partition)) { addPartition(partition); } } List<Short> partitionList = Arrays.asList(partitions); List<Short> toBeRemoved = new ArrayList<>(); for (Map.Entry<Short, Partition> entry : partitionMap.entrySet()) { if (!partitionList.contains(entry.getKey())) { toBeRemoved.add(entry.getKey()); } } for (Short partition : toBeRemoved) { removePartition(partition); } } PartitionGroupStoreManager(String topic, int partitionGroup, File base, Config config,
                                      PreloadBufferPool bufferPool); void recover(); String getTopic(); int getPartitionGroup(); ReadResult read(short partition, long index, int count, long maxSize); long getLeftIndex(short partition); long getLeftIndexAndCheck(short partition); long getRightIndex(short partition); long getRightIndexAndCheck(short partition); @Override boolean serviceStatus(); @Override void enable(); @Override void disable(); @Override void setRightPosition(long position); @Override void clear(long position); @Override long commitPosition(); @Override int term(); @Override void term(int term); @Override ByteBuffer readEntryBuffer(long position, int length); @Override long appendEntryBuffer(ByteBuffer byteBuffer); @Override long position(long position, int offsetCount); @Override int lastEntryTerm(); @Override void commit(long position); @Override int getEntryTerm(long position); @Override long leftPosition(); long rightPosition(); @Override void close(); long getIndex(short partition, long timestamp);  }