mirror of
https://github.com/minio/minio.git
synced 2025-11-25 20:16:10 -05:00
Notification: Changes to persistent event store (#7658)
This patch includes the following changes in event store interface - Removes memory store. We will not persist events in memory anymore, if `queueDir` is not set. - Orders the events before replaying to the broker.
This commit is contained in:
committed by
kannappanr
parent
59e1d94770
commit
c4c79f61ce
@@ -68,8 +68,8 @@ func TestQueueStorePut(t *testing.T) {
|
||||
}
|
||||
}
|
||||
// Count the events.
|
||||
if len(store.ListN(-1)) != 100 {
|
||||
t.Fatalf("ListN() Expected: 100, got %d", len(store.ListN(-1)))
|
||||
if len(store.List()) != 100 {
|
||||
t.Fatalf("List() Expected: 100, got %d", len(store.List()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ func TestQueueStoreGet(t *testing.T) {
|
||||
t.Fatal("Failed to put to queue store ", err)
|
||||
}
|
||||
}
|
||||
eventKeys := store.ListN(-1)
|
||||
eventKeys := store.List()
|
||||
// Get 10 events.
|
||||
if len(eventKeys) == 10 {
|
||||
for _, key := range eventKeys {
|
||||
@@ -103,7 +103,7 @@ func TestQueueStoreGet(t *testing.T) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
t.Fatalf("ListN() Expected: 10, got %d", len(eventKeys))
|
||||
t.Fatalf("List() Expected: 10, got %d", len(eventKeys))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ func TestQueueStoreDel(t *testing.T) {
|
||||
t.Fatal("Failed to put to queue store ", err)
|
||||
}
|
||||
}
|
||||
eventKeys := store.ListN(-1)
|
||||
eventKeys := store.List()
|
||||
// Remove all the events.
|
||||
if len(eventKeys) == 20 {
|
||||
for _, key := range eventKeys {
|
||||
@@ -134,11 +134,11 @@ func TestQueueStoreDel(t *testing.T) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
t.Fatalf("ListN() Expected: 20, got %d", len(eventKeys))
|
||||
t.Fatalf("List() Expected: 20, got %d", len(eventKeys))
|
||||
}
|
||||
|
||||
if len(store.ListN(-1)) != 0 {
|
||||
t.Fatalf("ListN() Expected: 0, got %d", len(store.ListN(-1)))
|
||||
if len(store.List()) != 0 {
|
||||
t.Fatalf("List() Expected: 0, got %d", len(store.List()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,12 +181,8 @@ func TestQueueStoreListN(t *testing.T) {
|
||||
t.Fatal("Failed to put to queue store ", err)
|
||||
}
|
||||
}
|
||||
// Should return only 5 event keys.
|
||||
if len(store.ListN(5)) != 5 {
|
||||
t.Fatalf("ListN(5) Expected: 5, got %d", len(store.ListN(5)))
|
||||
}
|
||||
// Should return all the event keys in the store.
|
||||
if len(store.ListN(-1)) != 10 {
|
||||
t.Fatalf("ListN(-1) Expected: 10, got %d", len(store.ListN(-1)))
|
||||
if len(store.List()) != 10 {
|
||||
t.Fatalf("List() Expected: 10, got %d", len(store.List()))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user