Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for objectPartIndex (0.13 sec)

  1. cmd/erasure-metadata_test.go

    		}
    
    		if index := objectPartIndex(fi.Parts, testCase.partNum); index != testCase.expectedIndex {
    			t.Fatalf("%+v: expected = %d, got: %d", testCase, testCase.expectedIndex, index)
    		}
    	}
    }
    
    // Test objectPartIndex(). generates a sample FileInfo data and asserts
    // the output of objectPartIndex() with the expected value.
    func TestObjectPartIndex(t *testing.T) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Jul 25 21:02:50 UTC 2024
    - 13.5K bytes
    - Viewed (0)
  2. cmd/erasure-metadata.go

    	case fi.MarkDeleted != ofi.MarkDeleted,
    		!fi.ReplicationState.Equal(ofi.ReplicationState):
    		return false
    	}
    	return true
    }
    
    // objectPartIndex - returns the index of matching object part number.
    // Returns -1 if the part cannot be found.
    func objectPartIndex(parts []ObjectPartInfo, partNumber int) int {
    	for i, part := range parts {
    		if partNumber == part.Number {
    			return i
    		}
    	}
    	return -1
    }
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Oct 31 22:10:24 UTC 2024
    - 21.3K bytes
    - Viewed (0)
  3. cmd/erasure-multipart.go

    	// Allocate parts similar to incoming slice.
    	fi.Parts = make([]ObjectPartInfo, len(parts))
    
    	// Validate each part and then commit to disk.
    	for i, part := range parts {
    		partIdx := objectPartIndex(currentFI.Parts, part.PartNumber)
    		// All parts should have same part number.
    		if partIdx == -1 {
    			invp := InvalidPart{
    				PartNumber: part.PartNumber,
    				GotETag:    part.ETag,
    			}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Sep 29 22:40:36 UTC 2024
    - 44.7K bytes
    - Viewed (0)
Back to top