mirror of
https://github.com/pgsty/minio.git
synced 2026-07-24 22:46:16 +03:00
api: Implement bucket notification. (#2271)
* Implement basic S3 notifications through queues Supports multiple queues and three basic queue types: 1. NilQueue -- messages don't get sent anywhere 2. LogQueue -- messages get logged 3. AmqpQueue -- messages are sent to an AMQP queue * api: Implement bucket notification. Supports two different queue types - AMQP - ElasticSearch. * Add support for redis
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
f85d94288d
commit
f248089523
@@ -64,17 +64,29 @@ func loadFormatFS(storageDisk StorageAPI) (format formatConfigV1, err error) {
|
||||
|
||||
// Should be called when process shuts down.
|
||||
func shutdownFS(storage StorageAPI) {
|
||||
// List if there are any multipart entries.
|
||||
_, err := storage.ListDir(minioMetaBucket, mpartMetaPrefix)
|
||||
if err != errFileNotFound {
|
||||
// Multipart directory is not empty hence do not remove .minio volume.
|
||||
// Multipart directory is not empty hence do not remove '.minio.sys' volume.
|
||||
os.Exit(0)
|
||||
}
|
||||
// List if there are any bucket configuration entries.
|
||||
_, err = storage.ListDir(minioMetaBucket, bucketConfigPrefix)
|
||||
if err != errFileNotFound {
|
||||
// Bucket config directory is not empty hence do not remove '.minio.sys' volume.
|
||||
os.Exit(0)
|
||||
}
|
||||
// Cleanup everything else.
|
||||
prefix := ""
|
||||
if err := cleanupDir(storage, minioMetaBucket, prefix); err != nil {
|
||||
os.Exit(0)
|
||||
return
|
||||
if err = cleanupDir(storage, minioMetaBucket, prefix); err != nil {
|
||||
errorIf(err, "Unable to cleanup minio meta bucket")
|
||||
os.Exit(1)
|
||||
}
|
||||
storage.DeleteVol(minioMetaBucket)
|
||||
if err = storage.DeleteVol(minioMetaBucket); err != nil {
|
||||
errorIf(err, "Unable to delete minio meta bucket", minioMetaBucket)
|
||||
os.Exit(1)
|
||||
}
|
||||
// Successful exit.
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
@@ -184,6 +196,10 @@ func (fs fsObjects) ListBuckets() ([]BucketInfo, error) {
|
||||
if !IsValidBucketName(vol.Name) {
|
||||
continue
|
||||
}
|
||||
// Ignore the volume special bucket.
|
||||
if vol.Name == minioMetaBucket {
|
||||
continue
|
||||
}
|
||||
bucketInfos = append(bucketInfos, BucketInfo{
|
||||
Name: vol.Name,
|
||||
Created: vol.Created,
|
||||
|
||||
Reference in New Issue
Block a user