Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AzDatalake] Feedback + Service Client #21096

Merged
merged 74 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
e8167a2
Enable gocritic during linting (#20715)
jhendrixMSFT Apr 28, 2023
86627ae
Cosmos DB: Enable merge support (#20716)
ealsur Apr 28, 2023
8ac8c6d
[azservicebus, azeventhubs] Stress test and logging improvement (#20710)
richardpark-msft May 1, 2023
9111616
update proxy version (#20712)
azure-sdk May 1, 2023
d6bf190
Return an error when you try to send a message that's too large. (#20…
richardpark-msft May 1, 2023
e2693bd
Changes in test that is failing in pipeline (#20693)
siminsavani-msft May 2, 2023
03f0ac3
[azservicebus, azeventhubs] Treat 'entity full' as a fatal error (#20…
richardpark-msft May 2, 2023
838842d
[azservicebus/azeventhubs] Redirect stderr and stdout to tee (#20726)
richardpark-msft May 3, 2023
20b4dd8
Update changelog with latest features (#20730)
jhendrixMSFT May 3, 2023
745d967
pass along the artifact name so we can override it later (#20732)
azure-sdk May 3, 2023
6dfd0cb
[azeventhubs] Fixing checkpoint store race condition (#20727)
richardpark-msft May 3, 2023
ed7f3c7
Fix azidentity troubleshooting guide link (#20736)
chlowell May 3, 2023
b2cddab
[Release] sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/0.1.0 (…
Alancere May 4, 2023
2a8d96d
add sdk/resourcemanager/postgresql/armpostgresql live test (#20685)
Alancere May 4, 2023
0d22aed
add sdk/resourcemanager/eventhub/armeventhub live test (#20686)
Alancere May 4, 2023
5fa7df4
add sdk/resourcemanager/compute/armcompute live test (#20048)
Alancere May 4, 2023
c005ed6
sdk/resourcemanager/network/armnetwork live test (#20331)
Alancere May 4, 2023
36f766d
add sdk/resourcemanager/cosmos/armcosmos live test (#20705)
Alancere May 4, 2023
9c9d62a
Increment package version after release of azcore (#20740)
azure-sdk May 4, 2023
8bc3450
[azeventhubs] Improperly resetting etag in the checkpoint store (#20737)
richardpark-msft May 4, 2023
e1a6152
Eng workflows sync and branch cleanup additions (#20743)
azure-sdk May 4, 2023
04b463d
[azeventhubs] Latest start position can also be inclusive (ie, get th…
richardpark-msft May 4, 2023
8849196
Update GitHubEventProcessor version and remove pull_request_review pr…
azure-sdk May 5, 2023
27f5ee0
Rename DisableAuthorityValidationAndInstanceDiscovery (#20746)
chlowell May 5, 2023
2eec707
fix (#20707)
Alancere May 6, 2023
22db2d4
AzFile (#20739)
souravgupta-msft May 8, 2023
0cbfd88
azfile: Fixing connection string parsing logic (#20798)
souravgupta-msft May 8, 2023
d54fb08
[azadmin] fix flaky test (#20758)
gracewilcox May 8, 2023
ad8ebd9
Prepare azidentity v1.3.0 for release (#20756)
chlowell May 8, 2023
e2a6f70
Fix broken podman link (#20801)
azure-sdk May 8, 2023
a59d912
[azquery] update doc comments (#20755)
gracewilcox May 8, 2023
bd3b467
Fixed contribution section (#20752)
bobtabor-msft May 8, 2023
132a01a
[azeventhubs,azservicebus] Some API cleanup, renames (#20754)
richardpark-msft May 8, 2023
8db51ca
Add supporting features to enable distributed tracing (#20301) (#20708)
jhendrixMSFT May 9, 2023
4a66b4f
Restore ARM CAE support for azcore beta (#20657)
chlowell May 9, 2023
7d4a3cb
Upgrade to stable azcore (#20808)
chlowell May 9, 2023
068c3be
Increment package version after release of data/azcosmos (#20807)
azure-sdk May 9, 2023
8e0f66e
Updating changelog (#20810)
souravgupta-msft May 9, 2023
ce926c4
Add fake package to azcore (#20711)
jhendrixMSFT May 9, 2023
1a145c5
Updating CHANGELOG.md (#20809)
siminsavani-msft May 9, 2023
90dfc5c
changelog (#20811)
tasherif-msft May 9, 2023
c7eda59
Increment package version after release of storage/azfile (#20813)
azure-sdk May 9, 2023
7fac0b5
Update changelog (azblob) (#20815)
siminsavani-msft May 9, 2023
498a2ef
[azquery] migration guide (#20742)
gracewilcox May 9, 2023
ccb967e
Increment package version after release of monitor/azquery (#20820)
azure-sdk May 9, 2023
f4e6a22
[keyvault] prep for release (#20819)
gracewilcox May 10, 2023
8fd8eda
Merge branch 'main' into feature/azdatalake
tasherif-msft May 11, 2023
c94fa00
Merge remote-tracking branch 'upstream/feature/azdatalake' into featu…
tasherif-msft May 11, 2023
fc0b2b5
Merge remote-tracking branch 'upstream/feature/azdatalake' into featu…
tasherif-msft Jun 12, 2023
6fb1694
Merge remote-tracking branch 'upstream/feature/azdatalake' into featu…
tasherif-msft Jun 19, 2023
4f7fe43
Merge remote-tracking branch 'upstream/feature/azdatalake' into featu…
tasherif-msft Jun 26, 2023
2b127ca
added new client methods
tasherif-msft Jun 27, 2023
4a76e11
moved access conditions and wrote first test
tasherif-msft Jun 27, 2023
a464998
added more tests
tasherif-msft Jun 28, 2023
9d02de3
added path listing
tasherif-msft Jun 28, 2023
cda3bcf
list deleted paths
tasherif-msft Jun 28, 2023
e552ebf
fixed formatter and added more tests
tasherif-msft Jun 29, 2023
98fc899
added more tests
tasherif-msft Jun 29, 2023
9e02ba2
marker fix
tasherif-msft Jun 29, 2023
6d8c039
log
tasherif-msft Jun 29, 2023
cdb95ab
fixed constructor validation
tasherif-msft Jun 29, 2023
a60f50c
comment
tasherif-msft Jun 29, 2023
6011e99
assets update:
tasherif-msft Jun 29, 2023
7dc76c0
some cleanup
tasherif-msft Jun 30, 2023
8748f3b
missing models and log
tasherif-msft Jun 30, 2023
42332ec
cleanup, resolved apiview feedback
tasherif-msft Jun 30, 2023
e8bc0c3
test
tasherif-msft Jul 4, 2023
3dac9d0
Merge remote-tracking branch 'upstream/feature/azdatalake' into featu…
tasherif-msft Jul 4, 2023
39a93fd
merged branch
tasherif-msft Jul 4, 2023
bb481d0
cleanup
tasherif-msft Jul 5, 2023
0e1e044
added service tests
tasherif-msft Jul 6, 2023
d31e6a0
implemented listing
tasherif-msft Jul 6, 2023
7a865a6
cleanup
tasherif-msft Jul 6, 2023
aac9d46
cleanup
tasherif-msft Jul 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions sdk/storage/azdatalake/directory/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/exported"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/shared"
"strings"
)

// ClientOptions contains the optional parameters when creating a Client.
Expand All @@ -30,10 +29,9 @@ type Client base.CompositeClient[generated.PathClient, generated.PathClient, blo
// - cred - an Azure AD credential, typically obtained via the azidentity module
// - options - client options; pass nil to accept the default values
func NewClient(directoryURL string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error) {
blobURL := strings.Replace(directoryURL, ".dfs.", ".blob.", 1)
directoryURL = strings.Replace(directoryURL, ".blob.", ".dfs.", 1)
blobURL, directoryURL := shared.GetURLs(directoryURL)

authPolicy := shared.NewStorageChallengePolicy(cred)
authPolicy := runtime.NewBearerTokenPolicy(cred, []string{shared.TokenScope}, nil)
conOptions := shared.GetClientOptions(options)
plOpts := runtime.PipelineOptions{
PerRetry: []policy.Policy{authPolicy},
Expand Down Expand Up @@ -62,8 +60,7 @@ func NewClient(directoryURL string, cred azcore.TokenCredential, options *Client
// - directoryURL - the URL of the storage account e.g. https://<account>.dfs.core.windows.net/fs/dir?<sas token>
// - options - client options; pass nil to accept the default values
func NewClientWithNoCredential(directoryURL string, options *ClientOptions) (*Client, error) {
blobURL := strings.Replace(directoryURL, ".dfs.", ".blob.", 1)
directoryURL = strings.Replace(directoryURL, ".blob.", ".dfs.", 1)
blobURL, directoryURL := shared.GetURLs(directoryURL)

conOptions := shared.GetClientOptions(options)
plOpts := runtime.PipelineOptions{}
Expand Down Expand Up @@ -91,8 +88,7 @@ func NewClientWithNoCredential(directoryURL string, options *ClientOptions) (*Cl
// - cred - a SharedKeyCredential created with the matching storage account and access key
// - options - client options; pass nil to accept the default values
func NewClientWithSharedKeyCredential(directoryURL string, cred *SharedKeyCredential, options *ClientOptions) (*Client, error) {
blobURL := strings.Replace(directoryURL, ".dfs.", ".blob.", 1)
directoryURL = strings.Replace(directoryURL, ".blob.", ".dfs.", 1)
blobURL, directoryURL := shared.GetURLs(directoryURL)

authPolicy := exported.NewSharedKeyCredPolicy(cred)
conOptions := shared.GetClientOptions(options)
Expand All @@ -112,8 +108,11 @@ func NewClientWithSharedKeyCredential(directoryURL string, cred *SharedKeyCreden
blobClientOpts := blob.ClientOptions{
ClientOptions: options.ClientOptions,
}
blobSharedKeyCredential, _ := blob.NewSharedKeyCredential(cred.AccountName(), cred.AccountKey())
blobClient, _ := blob.NewClientWithSharedKeyCredential(blobURL, blobSharedKeyCredential, &blobClientOpts)
blobSharedKey, err := cred.ConvertToBlobSharedKey()
if err != nil {
return nil, err
}
blobClient, _ := blob.NewClientWithSharedKeyCredential(blobURL, blobSharedKey, &blobClientOpts)
dirClient := base.NewPathClient(directoryURL, blobURL, blobClient, azClient, nil, (*base.ClientOptions)(conOptions))

return (*Client)(dirClient), nil
Expand Down
20 changes: 9 additions & 11 deletions sdk/storage/azdatalake/file/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/exported"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/shared"
"strings"
)

// ClientOptions contains the optional parameters when creating a Client.
Expand All @@ -30,10 +29,8 @@ type Client base.CompositeClient[generated.PathClient, generated.PathClient, blo
// - cred - an Azure AD credential, typically obtained via the azidentity module
// - options - client options; pass nil to accept the default values
func NewClient(fileURL string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error) {
blobURL := strings.Replace(fileURL, ".dfs.", ".blob.", 1)
fileURL = strings.Replace(fileURL, ".blob.", ".dfs.", 1)

authPolicy := shared.NewStorageChallengePolicy(cred)
blobURL, fileURL := shared.GetURLs(fileURL)
authPolicy := runtime.NewBearerTokenPolicy(cred, []string{shared.TokenScope}, nil)
conOptions := shared.GetClientOptions(options)
plOpts := runtime.PipelineOptions{
PerRetry: []policy.Policy{authPolicy},
Expand Down Expand Up @@ -62,8 +59,7 @@ func NewClient(fileURL string, cred azcore.TokenCredential, options *ClientOptio
// - fileURL - the URL of the storage account e.g. https://<account>.dfs.core.windows.net/fs/file.txt?<sas token>
// - options - client options; pass nil to accept the default values
func NewClientWithNoCredential(fileURL string, options *ClientOptions) (*Client, error) {
blobURL := strings.Replace(fileURL, ".dfs.", ".blob.", 1)
fileURL = strings.Replace(fileURL, ".blob.", ".dfs.", 1)
blobURL, fileURL := shared.GetURLs(fileURL)

conOptions := shared.GetClientOptions(options)
plOpts := runtime.PipelineOptions{}
Expand Down Expand Up @@ -91,8 +87,7 @@ func NewClientWithNoCredential(fileURL string, options *ClientOptions) (*Client,
// - cred - a SharedKeyCredential created with the matching storage account and access key
// - options - client options; pass nil to accept the default values
func NewClientWithSharedKeyCredential(fileURL string, cred *SharedKeyCredential, options *ClientOptions) (*Client, error) {
blobURL := strings.Replace(fileURL, ".dfs.", ".blob.", 1)
fileURL = strings.Replace(fileURL, ".blob.", ".dfs.", 1)
blobURL, fileURL := shared.GetURLs(fileURL)

authPolicy := exported.NewSharedKeyCredPolicy(cred)
conOptions := shared.GetClientOptions(options)
Expand All @@ -112,8 +107,11 @@ func NewClientWithSharedKeyCredential(fileURL string, cred *SharedKeyCredential,
blobClientOpts := blob.ClientOptions{
ClientOptions: options.ClientOptions,
}
blobSharedKeyCredential, _ := blob.NewSharedKeyCredential(cred.AccountName(), cred.AccountKey())
blobClient, _ := blob.NewClientWithSharedKeyCredential(blobURL, blobSharedKeyCredential, &blobClientOpts)
blobSharedKey, err := cred.ConvertToBlobSharedKey()
if err != nil {
return nil, err
}
blobClient, _ := blob.NewClientWithSharedKeyCredential(blobURL, blobSharedKey, &blobClientOpts)
fileClient := base.NewPathClient(fileURL, blobURL, blobClient, azClient, nil, (*base.ClientOptions)(conOptions))

return (*Client)(fileClient), nil
Expand Down
23 changes: 9 additions & 14 deletions sdk/storage/azdatalake/filesystem/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/datalakeerror"
Expand All @@ -21,7 +20,6 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/shared"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/sas"
"net/http"
"strings"
"time"
)

Expand All @@ -36,10 +34,8 @@ type Client base.CompositeClient[generated.FileSystemClient, generated.FileSyste
// - cred - an Azure AD credential, typically obtained via the azidentity module
// - options - client options; pass nil to accept the default values
func NewClient(filesystemURL string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error) {
containerURL := strings.Replace(filesystemURL, ".dfs.", ".blob.", 1)
filesystemURL = strings.Replace(filesystemURL, ".blob.", ".dfs.", 1)

authPolicy := shared.NewStorageChallengePolicy(cred)
containerURL, filesystemURL := shared.GetURLs(filesystemURL)
authPolicy := runtime.NewBearerTokenPolicy(cred, []string{shared.TokenScope}, nil)
conOptions := shared.GetClientOptions(options)
plOpts := runtime.PipelineOptions{
PerRetry: []policy.Policy{authPolicy},
Expand Down Expand Up @@ -68,9 +64,7 @@ func NewClient(filesystemURL string, cred azcore.TokenCredential, options *Clien
// - filesystemURL - the URL of the storage account e.g. https://<account>.dfs.core.windows.net/fs?<sas token>
// - options - client options; pass nil to accept the default values
func NewClientWithNoCredential(filesystemURL string, options *ClientOptions) (*Client, error) {
containerURL := strings.Replace(filesystemURL, ".dfs.", ".blob.", 1)
filesystemURL = strings.Replace(filesystemURL, ".blob.", ".dfs.", 1)

containerURL, filesystemURL := shared.GetURLs(filesystemURL)
conOptions := shared.GetClientOptions(options)
plOpts := runtime.PipelineOptions{}
base.SetPipelineOptions((*base.ClientOptions)(conOptions), &plOpts)
Expand All @@ -97,9 +91,7 @@ func NewClientWithNoCredential(filesystemURL string, options *ClientOptions) (*C
// - cred - a SharedKeyCredential created with the matching storage account and access key
// - options - client options; pass nil to accept the default values
func NewClientWithSharedKeyCredential(filesystemURL string, cred *SharedKeyCredential, options *ClientOptions) (*Client, error) {
containerURL := strings.Replace(filesystemURL, ".dfs.", ".blob.", 1)
filesystemURL = strings.Replace(filesystemURL, ".blob.", ".dfs.", 1)

containerURL, filesystemURL := shared.GetURLs(filesystemURL)
authPolicy := exported.NewSharedKeyCredPolicy(cred)
conOptions := shared.GetClientOptions(options)
plOpts := runtime.PipelineOptions{
Expand All @@ -118,8 +110,11 @@ func NewClientWithSharedKeyCredential(filesystemURL string, cred *SharedKeyCrede
containerClientOpts := container.ClientOptions{
ClientOptions: options.ClientOptions,
}
blobSharedKeyCredential, _ := blob.NewSharedKeyCredential(cred.AccountName(), cred.AccountKey())
blobContainerClient, _ := container.NewClientWithSharedKeyCredential(containerURL, blobSharedKeyCredential, &containerClientOpts)
blobSharedKey, err := cred.ConvertToBlobSharedKey()
if err != nil {
return nil, err
}
blobContainerClient, _ := container.NewClientWithSharedKeyCredential(containerURL, blobSharedKey, &containerClientOpts)
fsClient := base.NewFilesystemClient(filesystemURL, containerURL, blobContainerClient, azClient, cred, (*base.ClientOptions)(conOptions))

return (*Client)(fsClient), nil
Expand Down
2 changes: 2 additions & 0 deletions sdk/storage/azdatalake/filesystem/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const (
Filesystem PublicAccessType = azblob.PublicAccessTypeContainer
)

// TODO: figure out a way to import this from datalake rather than blob again

// StatusType defines values for StatusType
type StatusType = lease.StatusType

Expand Down
6 changes: 6 additions & 0 deletions sdk/storage/azdatalake/filesystem/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,9 @@ type LeaseAccessConditions = exported.LeaseAccessConditions

// ModifiedAccessConditions contains a group of parameters for specifying access conditions.
type ModifiedAccessConditions = exported.ModifiedAccessConditions

// PathList contains the path list
type PathList = generated.PathList

// Path contains the path properties
type Path = generated.Path
19 changes: 11 additions & 8 deletions sdk/storage/azdatalake/filesystem/responses.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,28 @@ type SetAccessPolicyResponse = container.SetAccessPolicyResponse
// GetAccessPolicyResponse contains the response from method FilesystemClient.GetAccessPolicy.
type GetAccessPolicyResponse struct {
// PublicAccess contains the information returned from the x-ms-blob-public-access header response.
PublicAccess *PublicAccessType `xml:"BlobPublicAccess"`
PublicAccess *PublicAccessType

// ClientRequestID contains the information returned from the x-ms-client-request-id header response.
ClientRequestID *string `xml:"ClientRequestID"`
ClientRequestID *string

// Date contains the information returned from the Date header response.
Date *time.Time `xml:"Date"`
Date *time.Time

// ETag contains the information returned from the ETag header response.
ETag *azcore.ETag `xml:"ETag"`
ETag *azcore.ETag

// LastModified contains the information returned from the Last-Modified header response.
LastModified *time.Time `xml:"LastModified"`
LastModified *time.Time

// RequestID contains the information returned from the x-ms-request-id header response.
RequestID *string `xml:"RequestID"`
RequestID *string

// a collection of signed identifiers
SignedIdentifiers []*SignedIdentifier `xml:"SignedIdentifier"`
SignedIdentifiers []*SignedIdentifier

// Version contains the information returned from the x-ms-version header response.
Version *string `xml:"Version"`
Version *string
}

// since we want to remove the blob prefix in access type
Expand Down Expand Up @@ -140,3 +140,6 @@ type ListPathsSegmentResponse = generated.FileSystemClientListPathsResponse

// ListDeletedPathsSegmentResponse contains the response from method FilesystemClient.ListPathsSegment.
type ListDeletedPathsSegmentResponse = generated.FileSystemClientListBlobHierarchySegmentResponse

// ListBlobsHierarchySegmentResponse contains the response from method FilesystemClient.ListBlobsHierarchySegment.
type ListBlobsHierarchySegmentResponse = generated.ListBlobsHierarchySegmentResponse
2 changes: 1 addition & 1 deletion sdk/storage/azdatalake/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake
go 1.18

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.5.0
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0
github.com/stretchr/testify v1.7.1
Expand Down
4 changes: 2 additions & 2 deletions sdk/storage/azdatalake/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.5.0 h1:xGLAFFd9D3iLGxYiUGPdITSzsFmU1K8VtfuUHWAoN7M=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.5.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM=
Expand Down
22 changes: 4 additions & 18 deletions sdk/storage/azdatalake/internal/base/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,6 @@ type ClientOptions struct {
pipelineOptions *runtime.PipelineOptions
}

type Client[T any] struct {
inner *T
sharedKey *exported.SharedKeyCredential
options *ClientOptions
}

func InnerClient[T any](client *Client[T]) *T {
return client.inner
}

func SharedKey[T any](client *Client[T]) *exported.SharedKeyCredential {
return client.sharedKey
}

func GetClientOptions[T any](client *Client[T]) *ClientOptions {
return client.options
}

func GetPipelineOptions(clOpts *ClientOptions) *runtime.PipelineOptions {
return clOpts.pipelineOptions
}
Expand Down Expand Up @@ -96,3 +78,7 @@ func NewPathClient(dirURL string, dirURLWithBlobEndpoint string, client *blob.Cl
options: options,
}
}

func GetCompositeClientOptions[T, K, U any](client *CompositeClient[T, K, U]) *ClientOptions {
return client.options
}
20 changes: 20 additions & 0 deletions sdk/storage/azdatalake/internal/exported/log_events.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//go:build go1.18
// +build go1.18

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

package exported

import (
"github.com/Azure/azure-sdk-for-go/sdk/internal/log"
)

// NOTE: these are publicly exported via type-aliasing in azdatalake/log.go
const (
// EventUpload is used when we compute number of chunks to upload and size of each chunk.
EventUpload log.Event = "azdatalake.Upload"

// EventError is used for logging errors.
EventError log.Event = "azdatalake.Error"
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"crypto/sha256"
"encoding/base64"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
"net/http"
"net/url"
"sort"
Expand Down Expand Up @@ -48,9 +49,12 @@ func (c *SharedKeyCredential) AccountName() string {
return c.accountName
}

// AccountKey returns the Storage account's name.
func (c *SharedKeyCredential) AccountKey() string {
return c.accountKeyString
func (c *SharedKeyCredential) ConvertToBlobSharedKey() (*azblob.SharedKeyCredential, error) {
cred, err := azblob.NewSharedKeyCredential(c.accountName, c.accountKeyString)
if err != nil {
return nil, err
}
return cred, nil
}

// SetAccountKey replaces the existing account key with the specified account key.
Expand Down
Loading