Skip to content

Commit

Permalink
[router] RouterExceptionAndTrackingUtils allocation reduction (#1413)
Browse files Browse the repository at this point in the history
Removed all Optionals from RouterExceptionAndTrackingUtils.

Miscellaneous:

- Tweaked flaky unit test RouterRequestThrottlingTest.

- Deleted a disabled test in TestZKStore.

- Tweaked the main README page.
  • Loading branch information
FelixGV authored Dec 21, 2024
1 parent aca711b commit 8f77653
Show file tree
Hide file tree
Showing 19 changed files with 266 additions and 275 deletions.
5 changes: 3 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ Feel free to engage with the community using our:
- [<img src="assets/icons/github-icon.svg" width="15" />](./dev_guide/how_to/how_to.md) [Contributor's guide](./dev_guide/how_to/how_to.md)

Follow us to hear more about the progress of the Venice project and community:
- [<img src="assets/icons/hashnode-icon.svg" width="15" />](https://blog.venicedb.org) [Official blog](https://blog.venicedb.org)
- [<img src="assets/icons/hashnode-icon.svg" width="15" />](https://blog.venicedb.org) [Blog](https://blog.venicedb.org)
- [<img src="assets/icons/bluesky-icon.svg" width="15" />](https://bsky.app/profile/venicedb.org) [Bluesky handle](https://bsky.app/profile/venicedb.org)
- [<img src="assets/icons/linkedin-icon.svg" width="15" />](https://www.linkedin.com/company/venicedb) [LinkedIn page](https://www.linkedin.com/company/venicedb)
- [<img src="assets/icons/x-icon.svg" width="15" />](https://x.com/VeniceDataBase) [X page](https://x.com/VeniceDataBase)
- [<img src="assets/icons/x-icon.svg" width="15" />](https://x.com/VeniceDataBase) [X handle](https://x.com/VeniceDataBase)
- [<img src="assets/icons/youtube-icon.svg" width="15" />](https://youtube.com/@venicedb) [YouTube channel](https://youtube.com/@venicedb)

4 changes: 4 additions & 0 deletions docs/assets/icons/bluesky-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion docs/assets/icons/github-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 18 additions & 9 deletions docs/assets/style/venice_full_lion_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public class HttpConstants {
public static final String VENICE_RETRY = "X-VENICE-RETRY";

public static final String VENICE_COMPRESSION_STRATEGY = "X-VENICE-COMPRESSION-STRATEGY";
/**
* N.B.: There seems to be an assumption that this header's value will contain just a single compression scheme (GZIP)
* and that it's not correct to pass a list of supported compression strategies (as one might expect). So we
* need to be careful if we ever intend to evolve the way this header is used to accommodate multiple schemes.
*/
public static final String VENICE_SUPPORTED_COMPRESSION_STRATEGY = "X-VENICE-SUPPORTED-COMPRESSION-STRATEGY";

public static final String VENICE_STREAMING = "X-VENICE-STREAMING";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,34 +395,6 @@ public void invalidStoreNameThrows() {
1);
}

/**
* We're not relying on push ID uniqueness. We can reenable this test if we start relying on (and enforcing) push ID uniqueness
*/
@Test(groups = { "flaky" })
public void cannotAddDifferentVersionsWithSamePushId() {
String storeName = "storeName";
Store store = new ZKStore(
storeName,
"owner",
System.currentTimeMillis(),
PersistenceType.IN_MEMORY,
RoutingStrategy.CONSISTENT_HASH,
ReadStrategy.ANY_OF_ONLINE,
OfflinePushStrategy.WAIT_N_MINUS_ONE_REPLCIA_PER_PARTITION,
1);
String duplicatePushJobId = "pushId";
Version versionOne = new VersionImpl(storeName, 1, duplicatePushJobId);
store.addVersion(versionOne);
Version versionTwo = new VersionImpl(storeName, 2, duplicatePushJobId);
try {
store.addVersion(versionTwo);
Assert.fail("Store must not allow adding a new version with same pushId");
} catch (Exception e) {
// expected
LOGGER.info("Expected exception: {}", e.getLocalizedMessage());
}
}

@Test
public void testStoreLevelAcl() {
Store store = new ZKStore(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ static StatefulServiceProvider<MockVeniceRouterWrapper> generateService(
doReturn(CompressionStrategy.NO_OP).when(mockStore).getCompressionStrategy();
HelixReadOnlyStoreRepository mockMetadataRepository = Mockito.mock(HelixReadOnlyStoreRepository.class);
doReturn(mockStore).when(mockMetadataRepository).getStore(Mockito.anyString());
doReturn(mockStore).when(mockMetadataRepository).getStoreOrThrow(Mockito.anyString());

Version mockVersion = Mockito.mock(Version.class);
doReturn(mockVersion).when(mockStore).getVersion(Mockito.anyInt());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;

import com.github.luben.zstd.Zstd;
Expand Down Expand Up @@ -46,7 +45,6 @@
import com.linkedin.venice.helix.SafeHelixManager;
import com.linkedin.venice.helix.VeniceOfflinePushMonitorAccessor;
import com.linkedin.venice.kafka.protocol.state.PartitionState;
import com.linkedin.venice.meta.DataReplicationPolicy;
import com.linkedin.venice.meta.IngestionMode;
import com.linkedin.venice.meta.Instance;
import com.linkedin.venice.meta.OfflinePushStrategy;
Expand Down Expand Up @@ -656,23 +654,6 @@ public static void verifyDCConfigNativeAndActiveRepl(
});
}

public static void verifyHybridStoreDataReplicationPolicy(
String storeName,
DataReplicationPolicy dataReplicationPolicy,
ControllerClient... controllerClients) {
TestUtils.waitForNonDeterministicAssertion(60, TimeUnit.SECONDS, true, () -> {
for (ControllerClient controllerClient: controllerClients) {
StoreResponse storeResponse = assertCommand(controllerClient.getStore(storeName));
assertNotNull(storeResponse.getStore(), "Store should not be null");
assertNotNull(storeResponse.getStore().getHybridStoreConfig(), "Hybrid store config should not be null");
assertEquals(
storeResponse.getStore().getHybridStoreConfig().getDataReplicationPolicy(),
dataReplicationPolicy,
"The data replication policy does not match.");
}
});
}

public static StoreIngestionTaskFactory.Builder getStoreIngestionTaskBuilder(String storeName) {
VeniceServerConfig mockVeniceServerConfig = mock(VeniceServerConfig.class);
doReturn(false).when(mockVeniceServerConfig).isHybridQuotaEnabled();
Expand Down
Loading

0 comments on commit 8f77653

Please sign in to comment.