Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena_MET
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Plebani
athena_MET
Commits
5608e137
Commit
5608e137
authored
7 years ago
by
scott snyder
Browse files
Options
Downloads
Patches
Plain Diff
ByteStreamStoragePlugins: Comply with ATLAS naming conventions.
Private data members should start with m_. Former-commit-id:
3d703488
parent
892c72e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Event/ByteStreamStoragePlugins/src/fReadDavix.cxx
+23
-23
23 additions, 23 deletions
Event/ByteStreamStoragePlugins/src/fReadDavix.cxx
Event/ByteStreamStoragePlugins/src/fReadDavix.h
+7
-7
7 additions, 7 deletions
Event/ByteStreamStoragePlugins/src/fReadDavix.h
with
30 additions
and
30 deletions
Event/ByteStreamStoragePlugins/src/fReadDavix.cxx
+
23
−
23
View file @
5608e137
...
...
@@ -33,13 +33,13 @@ static int TDavixFile_http_authn_cert_X509(void *userdata, const Davix::SessionI
fReadDavix
::
fReadDavix
()
{
m_pfd
=
0
;
fO
ffset
=
0
;
fd
=
nullptr
;
m_o
ffset
=
0
;
m_
fd
=
nullptr
;
davixParam
=
new
Davix
::
RequestParams
();
err
=
NULL
;
pos
=
new
Davix
::
DavPosix
(
&
c
);
//pos = &c;
m_
davixParam
=
new
Davix
::
RequestParams
();
m_
err
=
NULL
;
m_
pos
=
new
Davix
::
DavPosix
(
&
m_
c
);
//
m_
pos = &
m_
c;
// enableGridMode
...
...
@@ -47,10 +47,10 @@ fReadDavix::fReadDavix()
if
(
(
env_var
=
std
::
getenv
(
"X509_CERT_DIR"
))
==
NULL
){
env_var
=
"/etc/grid-security/certificates/"
;
}
davixParam
->
addCertificateAuthorityPath
(
env_var
);
davixParam
->
setTransparentRedirectionSupport
(
true
);
cert
=
new
Davix
::
X509Credential
();
davixParam
->
setClientCertCallbackX509
(
&
TDavixFile_http_authn_cert_X509
,
NULL
);
m_
davixParam
->
addCertificateAuthorityPath
(
env_var
);
m_
davixParam
->
setTransparentRedirectionSupport
(
true
);
m_
cert
=
new
Davix
::
X509Credential
();
m_
davixParam
->
setClientCertCallbackX509
(
&
TDavixFile_http_authn_cert_X509
,
NULL
);
}
...
...
@@ -73,23 +73,23 @@ bool fReadDavix::isEoF()
bool
fReadDavix
::
fileExists
(
std
::
string
fName
)
const
{
Davix
::
DavixError
*
err2
=
NULL
;
DAVIX_FD
*
pfd
=
pos
->
open
(
davixParam
,
fName
.
c_str
(),
O_RDONLY
,
&
err2
);
DAVIX_FD
*
pfd
=
m_
pos
->
open
(
m_
davixParam
,
fName
.
c_str
(),
O_RDONLY
,
&
err2
);
if
(
pfd
==
0
)
return
false
;
pos
->
close
(
pfd
,
&
err2
);
m_
pos
->
close
(
pfd
,
&
err2
);
return
true
;
}
void
fReadDavix
::
openFile
(
std
::
string
fName
)
{
if
(
this
->
isOpen
())
this
->
closeFile
();
fd
=
pos
->
open
(
davixParam
,
fName
.
c_str
(),
O_RDONLY
,
&
err
);
fO
ffset
=
0
;
m_
fd
=
m_
pos
->
open
(
m_
davixParam
,
fName
.
c_str
(),
O_RDONLY
,
&
m_
err
);
m_o
ffset
=
0
;
m_pfd
=
1
;
}
void
fReadDavix
::
closeFile
()
{
if
(
m_pfd
!=
0
)
pos
->
close
(
fd
,
&
err
);
if
(
m_pfd
!=
0
)
m_
pos
->
close
(
m_
fd
,
&
m_
err
);
m_pfd
=
0
;
}
...
...
@@ -101,16 +101,16 @@ void fReadDavix::readData(char *buffer, unsigned int sizeBytes)
unsigned
int
totalRead
=
0
,
ntry
=
0
;
while
(
sizeBytes
>
totalRead
)
{
ssize_t
ret
=
pos
->
pread
(
fd
,
buffer
,
sizeBytes
,
fO
ffset
,
&
err
);
ssize_t
ret
=
m_
pos
->
pread
(
m_
fd
,
buffer
,
sizeBytes
,
m_o
ffset
,
&
m_
err
);
if
(
ret
<
0
)
{
std
::
stringstream
mystream
;
mystream
<<
"fReadDavix::readData: can not read data with davix "
<<
err
->
getErrMsg
().
c_str
()
<<
" "
<<
err
->
getStatus
();
Davix
::
DavixError
::
clearError
(
&
err
);
mystream
<<
"fReadDavix::readData: can not read data with davix "
<<
m_
err
->
getErrMsg
().
c_str
()
<<
" "
<<
m_
err
->
getStatus
();
Davix
::
DavixError
::
clearError
(
&
m_
err
);
EventStorage
::
ReadingIssue
ci
(
ERS_HERE
,
mystream
.
str
().
c_str
());
ers
::
warning
(
ci
);
return
;
}
else
{
fO
ffset
+=
ret
;
m_o
ffset
+=
ret
;
}
totalRead
+=
ret
;
++
ntry
;
if
(
ntry
>
5
)
{
...
...
@@ -129,22 +129,22 @@ void fReadDavix::readData(char *buffer, unsigned int sizeBytes)
int64_t
fReadDavix
::
getPosition
()
{
if
(
this
->
isOpen
())
return
fO
ffset
;
if
(
this
->
isOpen
())
return
m_o
ffset
;
return
-
1
;
}
void
fReadDavix
::
setPosition
(
int64_t
p
)
{
if
(
this
->
isOpen
())
fO
ffset
=
p
;
if
(
this
->
isOpen
())
m_o
ffset
=
p
;
}
void
fReadDavix
::
setPositionFromEnd
(
int64_t
p
)
{
dav_off_t
ret
;
if
(
this
->
isOpen
())
{
ret
=
pos
->
lseek64
(
fd
,
p
,
SEEK_END
,
&
err
);
fO
ffset
=
ret
;
ret
=
m_
pos
->
lseek64
(
m_
fd
,
p
,
SEEK_END
,
&
m_
err
);
m_o
ffset
=
ret
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Event/ByteStreamStoragePlugins/src/fReadDavix.h
+
7
−
7
View file @
5608e137
...
...
@@ -27,13 +27,13 @@ class fReadDavix : public fRead
private:
int
m_pfd
;
// current file, used as bool to check if file is open
int64_t
fO
ffset
;
Davix
::
Context
c
;
Davix
::
RequestParams
*
davixParam
;
Davix
::
DavixError
*
err
;
Davix
::
DavPosix
*
pos
;
Davix
::
X509Credential
*
cert
;
DAVIX_FD
*
fd
;
// davix pointer to current file
int64_t
m_o
ffset
;
Davix
::
Context
m_
c
;
Davix
::
RequestParams
*
m_
davixParam
;
Davix
::
DavixError
*
m_
err
;
Davix
::
DavPosix
*
m_
pos
;
Davix
::
X509Credential
*
m_
cert
;
DAVIX_FD
*
m_
fd
;
// davix pointer to current file
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment