summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapter/statsclient/statsclient.go6
-rw-r--r--adapter/statsclient/statseg_v2.go8
2 files changed, 10 insertions, 4 deletions
diff --git a/adapter/statsclient/statsclient.go b/adapter/statsclient/statsclient.go
index 0b16a77..8c5904d 100644
--- a/adapter/statsclient/statsclient.go
+++ b/adapter/statsclient/statsclient.go
@@ -505,13 +505,17 @@ func (sc *StatsClient) getStatEntriesOnIndex(vector dirVector, indexes ...uint32
if len(dirName) == 0 {
return
}
+ var t adapter.StatType
d := sc.CopyEntryData(dirPtr, ^uint32(0))
+ if d != nil {
+ t = d.Type()
+ }
entries = append(entries, adapter.StatEntry{
StatIdentifier: adapter.StatIdentifier{
Index: index,
Name: dirName,
},
- Type: d.Type(),
+ Type: t,
Data: d,
Symlink: adapter.StatType(dirType) == adapter.Symlink,
})
diff --git a/adapter/statsclient/statseg_v2.go b/adapter/statsclient/statseg_v2.go
index 16f1729..0780248 100644
--- a/adapter/statsclient/statseg_v2.go
+++ b/adapter/statsclient/statseg_v2.go
@@ -92,12 +92,14 @@ func (ss *statSegmentV2) GetEpoch() (int64, bool) {
func (ss *statSegmentV2) CopyEntryData(segment dirSegment, index uint32) adapter.Stat {
dirEntry := (*statSegDirectoryEntryV2)(segment)
- if dirEntry.unionData == 0 {
- debugf("data value or pointer not defined for %s", dirEntry.name)
+ typ := adapter.StatType(dirEntry.directoryType)
+ // skip zero pointer value
+ if typ != statDirScalarIndex && typ != statDirEmpty && dirEntry.unionData == 0 {
+ debugf("data pointer not defined for %s", dirEntry.name)
return nil
}
- switch adapter.StatType(dirEntry.directoryType) {
+ switch typ {
case statDirScalarIndex:
return adapter.ScalarStat(dirEntry.unionData)