@@ -191,7 +191,7 @@ && evaluateCondition(ingestDocumentSupplier, sampleInfo.script, sampleInfo.facto
191191                stats .samplesRejectedForCondition .increment ();
192192                return ;
193193            }
194-             RawDocument  sample  = getRawDocumentForIndexRequest (projectId ,  indexName , indexRequest );
194+             RawDocument  sample  = getRawDocumentForIndexRequest (indexName , indexRequest );
195195            if  (sampleInfo .offer (sample )) {
196196                stats .samples .increment ();
197197                logger .trace ("Sampling "  + indexRequest );
@@ -287,15 +287,14 @@ private static Script getScript(String conditional) throws IOException {
287287     * This represents a raw document as the user sent it to us in an IndexRequest. It only holds onto the information needed for the 
288288     * sampling API, rather than holding all of the fields a user might send in an IndexRequest. 
289289     */ 
290-     public  record  RawDocument (ProjectId   projectId ,  String  indexName , byte [] source , XContentType  contentType ) implements  Writeable  {
290+     public  record  RawDocument (String  indexName , byte [] source , XContentType  contentType ) implements  Writeable  {
291291
292292        public  RawDocument (StreamInput  in ) throws  IOException  {
293-             this (ProjectId . readFrom ( in ),  in .readString (), in .readByteArray (), in .readEnum (XContentType .class ));
293+             this (in .readString (), in .readByteArray (), in .readEnum (XContentType .class ));
294294        }
295295
296296        @ Override 
297297        public  void  writeTo (StreamOutput  out ) throws  IOException  {
298-             projectId .writeTo (out );
299298            out .writeString (indexName );
300299            out .writeByteArray (source );
301300            XContentHelper .writeTo (out , contentType );
@@ -306,15 +305,14 @@ public boolean equals(Object o) {
306305            if  (this  == o ) return  true ;
307306            if  (o  == null  || getClass () != o .getClass ()) return  false ;
308307            RawDocument  rawDocument  = (RawDocument ) o ;
309-             return  Objects .equals (projectId , rawDocument .projectId )
310-                 && Objects .equals (indexName , rawDocument .indexName )
308+             return  Objects .equals (indexName , rawDocument .indexName )
311309                && Arrays .equals (source , rawDocument .source )
312310                && contentType  == rawDocument .contentType ;
313311        }
314312
315313        @ Override 
316314        public  int  hashCode () {
317-             int  result  = Objects .hash (projectId ,  indexName , contentType );
315+             int  result  = Objects .hash (indexName , contentType );
318316            result  = 31  * result  + Arrays .hashCode (source );
319317            return  result ;
320318        }
@@ -325,13 +323,13 @@ public int hashCode() {
325323     * RawDocument might be a relatively expensive object memory-wise. Since the bytes are copied, subsequent changes to the indexRequest 
326324     * are not reflected in the RawDocument 
327325     */ 
328-     private  RawDocument  getRawDocumentForIndexRequest (ProjectId   projectId ,  String  indexName , IndexRequest  indexRequest ) {
326+     private  RawDocument  getRawDocumentForIndexRequest (String  indexName , IndexRequest  indexRequest ) {
329327        BytesReference  sourceReference  = indexRequest .source ();
330328        assert  sourceReference  != null  : "Cannot sample an IndexRequest with no source" ;
331329        byte [] source  = sourceReference .array ();
332330        final  byte [] sourceCopy  = new  byte [sourceReference .length ()];
333331        System .arraycopy (source , sourceReference .arrayOffset (), sourceCopy , 0 , sourceReference .length ());
334-         return  new  RawDocument (projectId ,  indexName , sourceCopy , indexRequest .getContentType ());
332+         return  new  RawDocument (indexName , sourceCopy , indexRequest .getContentType ());
335333    }
336334
337335    public  static  final  class  SampleStats  implements  Writeable , ToXContent  {
0 commit comments