Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5868#discussion_r30093953
  
    --- Diff: 
core/src/main/java/org/apache/spark/shuffle/unsafe/PackedRecordPointer.java ---
    @@ -0,0 +1,93 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.shuffle.unsafe;
    +
    +/**
    + * Wrapper around an 8-byte word that holds a 24-bit partition number and 
40-bit record pointer.
    + * <p>
    + * Within the long, the data is laid out as follows:
    + * <pre>
    + *   [24 bit partition number][13 bit memory page number][27 bit offset in 
page]
    + * </pre>
    + * This implies that the maximum addressable page size is 2^27 bits = 128 
megabytes, assuming that
    + * our offsets in pages are not 8-byte-word-aligned. Since we have 2^13 
pages (based off the
    + * 13-bit page numbers assigned by {@link 
org.apache.spark.unsafe.memory.TaskMemoryManager}), this
    + * implies that we can address 2^13 * 128 megabytes = 1 terabyte of RAM 
per task.
    + * <p>
    + * Assuming word-alignment would allow for a 1 gigabyte maximum page size, 
but we leave this
    + * optimization to future work as it will require more careful design to 
ensure that addresses are
    + * properly aligned (e.g. by padding records).
    + */
    +final class PackedRecordPointer {
    +
    +  static final int MAXIMUM_PAGE_SIZE_BYTES = 1 << 27;  // 128 megabytes
    +
    +  static final int MAXIMUM_PARTITION_ID = 1 << 24;  // 16777216
    --- End diff --
    
    Yep, good catch.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to